I want to check whether an app is present in my iphone or not. If it is present I want to launch it else open the App Store link of the app.
Please suggest the required
let naviURL = NSURL(string: "yandexnavi://build_route_on_map?lat_from=55.751802&lon_from=37.586684&lat_to=55.758192&lon_to=37.642817")!
let res = UIApplication.sharedApplication().openURL(naviURL)
if !res {
let appStoreURL = NSURL(string: "itms://itunes.apple.com/ru/app/andeks.navigator/id474500851?mt=8")!
UIApplication.sharedApplication().openURL(appStoreURL)
}