Skip to content

Instantly share code, notes, and snippets.

@adipascu
Last active August 10, 2016 15:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adipascu/e88c37f684018fe0a21e211589f8b440 to your computer and use it in GitHub Desktop.
Save adipascu/e88c37f684018fe0a21e211589f8b440 to your computer and use it in GitHub Desktop.
//example URL: vanillanav:navigateTo?venueId=8037&referenceId=19144
public func navigate(venueId: Int, destinationId: Int) -> Bool {
let navigateUrl = NSURL(string: "vanillanav:navigateTo?venueId=\(venueId)&referenceId=\(destinationId)")!
let sharedApp = UIApplication.sharedApplication()
if sharedApp.canOpenURL(navigateUrl) {
sharedApp.openURL(navigateUrl)
return true
} else {
let storeUrl = NSURL(string: "itms-apps://itunes.apple.com/ro/app/vanillanav/id1007116984")!
sharedApp.openURL(storeUrl)
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment