问题
I used that Tutorial but impossible to get the selected image in my App. I created with "New/File/Target", then I added a group in the "Capabilities". I can see the share icon when I go to the image gallery, but it does nothing when I click on the button.
Code Example:
- (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 @[];
}
What I would like is after selecting the image(s), I click on the share button, I choose my app in the list, and then it opens my app with the image(s) retrieved.
I check that two examples in the Apple doc, but nothing's work:
Open With...
Uti from Apple
Here is what I did, but this technique works only from the mail app:
Do you have any idea?
来源:https://stackoverflow.com/questions/46562841/ios-i-installed-the-share-extension-but-impossible-to-get-the-image-selected-f