I am creating an app that displays certain movie content. I have added a button that will allow the user to open that movie in IMDB to access more in depth information. I would like for the app to open the IMDB iPhone app if they have it installed, yet it only opens up the website in Safari. Here's what I have so far
@IBAction func imdbButtonClick(_ sender: UIButton) {
guard let url = URL(string: "http://www.imdb.com/title/tt5580390") else {
return //be safe
}
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
I know that IMDB is an app that supports universal links, but I don't know if that means it's possible to provide it in my own app.
- I know I should have a check to see if the user isn't running iOS 9. That will be added once I have this working on my test device