【发布时间】:2016-10-18 12:31:59
【问题描述】:
我正在尝试开发一个向主应用程序传递大量数据的小部件(今天的扩展)。
我在 info.plist 中添加了这个
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>TodayWidget</string>
</array>
<key>CFBundleURLName</key>
<string>xxx.xxx.xxx</string>
</dict>
</array>
我使用此代码从小部件调用(成功)应用程序
let url = URL(string:"TodayWidget://?key=value")
self.extensionContext?.open(url!, completionHandler: nil)
如何访问这些值?
我也看到了这个,但 xcode 警告我代码已被弃用
Pass data between two Apps by url scheme in swift?
谢谢!
【问题讨论】:
标签: ios iphone swift widget today-extension