有谁知道如何从应用程序扩展的视图控制器启动父应用程序?
我只想从其应用程序扩展启动主应用程序。
在 WWDC 会议上为 iOS 和 OS X 创建扩展,第 1 部分 https://developer.apple.com/videos/wwdc/2014/?id=205在 22 分钟左右,他们说要使用openURL:completionHandler:
UIViewController 的方法扩展上下文 https://developer.apple.com/library/prerelease/iOS/documentation/UIKit/Reference/UIViewController_Class/index.html#//apple_ref/occ/instp/UIViewController/extensionContext开一个自定义 URL 方案 https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/AdvancedAppTricks/AdvancedAppTricks.html#//apple_ref/doc/uid/TP40007072-CH7-SW50
[self.extensionContext openURL:[NSURL URLWithString:@"your-app-custom-url-scheme://your-internal-url"]
completionHandler:nil];
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)