This is the code I use:
let instagramURL = NSURL(string: \"instagram://app\") if UIApplication.shared.canOpenURL(instagramURL! as URL) { //Code } else {
For those who try to open the app using custom URL Scheme (assume that app FirstApp opens SecondApp):
LSApplicationQueriesSchemes