iOS:我安装了共享扩展,但不可能从我的应用程序库中select图像

我用这个教程,但不可能得到我的应用程序中选定的图像。 我使用“新build/文件/目标”创build,然后在“function”中添加了一个组。 当我进入图像库时,我可以看到共享图标,但是当我点击button时,它什么也不做。

代码示例:

- (BOOL)isContentValid { // Do validation of contentText and/or NSExtensionContext attachments here return YES; } - (void)didSelectPost { // This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments. // Inform the host that we're done, so it un-blocks its UI. Note: Alternatively you could call super's -didSelectPost, which will similarly complete the extension context. [self.extensionContext completeRequestReturningItems:@[] completionHandler:nil]; } - (NSArray *)configurationItems { // To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here. return @[]; } 

我想要的是select图像后,我点击分享button,我select我的应用程序在列表中,然后它打开我的应用程序与检索到的图像(S)。

在这里输入图像说明

我检查了苹果文档中的两个例子,但没有任何工作:
打开用…
来自苹果的Uti

这是我做的,但是这种技术只能从邮件应用程序中运行: 在这里输入图像说明

你有什么主意吗?