我有一个应用程序,当点击一个uibutton时,我想打开另一个已安装的应用程序(即Waze).我怎么能这样做?十分感谢.
解决方法
试试这个.例如,您想要打开Instagram应用程序:
var instagramHooks = "instagram://user?username=johndoe" var instagramUrl = NSURL(string: instagramHooks) if UIApplication.sharedApplication().canOpenURL(instagramUrl!) { UIApplication.sharedApplication().openURL(instagramUrl!) } else { //redirect to safari because the user doesn't have Instagram UIApplication.sharedApplication().openURL(NSURL(string: "http://instagram.com/")!) }