我有一个应用程序,当单击uibutton时,我想打开另一个已安装的应用程序(即位智)。我该怎么做?太谢谢了。
试试这个。例如,您要打开一个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/")!) }