次のコードを追加します。
- (IBAction)done {
// Return any edited content to the host app.
// This template doesn't do anything, so we just echo the passed in items.
NSURL *url = [NSURL URLWithString:@"lister://today"];
[self.extensionContext openURL:url completionHandler:^(BOOL success) {
NSLog(@"fun=%s after completion. success=%d", __func__, success);
}];
[self.extensionContext completeRequestReturningItems:self.extensionContext.inputItems completionHandler:nil];
}
アクション拡張ターゲットを作成した後。しかし、それはうまくいきません。
私の目的は、ユーザーが Photos.app (iOS のデフォルトの Photos.app またはギャラリーと呼ばれる) で写真を表示し、共有ボタンをクリックして拡張ビューを起動するときです。Photos.app から自分のアプリに画像を転送し、自分のアプリで画像を処理またはアップロードできます。
「CFBundleDocumentTypes」も試してみましたが、うまくいきません。
どんな助けでも大歓迎です。