[英]Open App From Widget IOS with Swift
How I can open my App from the Today Widget with Swift ? 如何使用Swift从Today Widget打开我的应用程序? I just want to pressed the Widget and than i would like to open my App.
我只是想按下Widget,而不是想打开我的应用程序。 I got right now a button on my whole view the button is clear.
我现在在我的整个视图上都有一个按钮,按钮很清晰。 But that don't work for me:( I need Help:)
但那对我不起作用:(我需要帮助:)
@IBAction func launchApp(sender: AnyObject) {
var url: NSURL = NSURL.URLWithString("AffordItLauncher://")
self.extensionContext?.openURL(url, completionHandler: nil)
}
In your info.plist you need to add the following: 在info.plist中,您需要添加以下内容:
And make sure that your app name is the same as the one in your url. 并确保您的应用名称与您的网址中的应用名称相同。 In your case, it should be
AffordItLauncher
在你的情况下,它应该是
AffordItLauncher
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.