I know I can open a url in safari with:
let myUrl = URL(string: "http://website.com")!
UIApplication.shared.open(myUrl, options: [:], completionHandler: nil)
Is there any way to open it in the google chrome app?
答案 0 :(得分:0)
To open a url in chrome, you need to:
googlechrome
to your app's Info.plist
file (and googlechromes
for https)googlechrome://
instead of http://
let myChromeUrl = URL(string: "googlechrome://website.com")!
UIApplication.shared.open(myChromeUrl, options: [:], completionHandler: nil)