我有一个具有自定义 UI 的 iOS 应用程序的共享扩展。运行扩展时,情节提要已加载,并且 UI 显示正常,但未beginRequestWithExtensionContext
调用。
(简化的)视图控制器代码:
class ShareViewController: UIViewController, NSExtensionRequestHandling {
// This is called…
override func viewDidLoad() {
super.viewDidLoad()
}
// …but this isn't!
override func beginRequestWithExtensionContext(context: NSExtensionContext) {
println("beginRequestWithExtensionContext")
}
}
NSExtensionAttributes:
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
<key>NSExtensionMainStoryboard</key>
<string>Share</string>
</dict>
</plist>
beginRequestWithExtensionContext
关于为什么不被调用的任何想法?