T
T
tigra2018-08-14 18:15:50
safari
tigra, 2018-08-14 18:15:50

How to open a link in Safari on iOS?

how to open a link in safari?
for example, on android, to open a link specifically in chrome, we form is
googlechrome://navigate?url=https://yandex.ru/
it possible to do something similar on iOS? open in safari or even in the same chrome, i.e. forced in some application

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Firdavs Khaydarov, 2018-08-29
@Recouse

http and https links open in Safari:

if let url = URL(string: "http://google.com") {
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

To open in chrome, you need to replace http/https with googlechrome/googlechromes:
if let url = URL(string: "http://google.com".replacingOccurrences(of: "http", with: "googlechrome")) {
    UIApplication.shared.open(url, options: [:], completionHandler: nil)
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question