Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can I share iOS URl Schema with parameter to be a link that I can click not just string

Tags:

ios

url-scheme

tazah://posts?postID=10 

I need to make this a clickable link without using http

like image 808
Amr AbdelWahab Avatar asked Sep 15 '25 11:09

Amr AbdelWahab


1 Answers

You can open urls using this code

UIApplication.shared.open(url, options: [:], completionHandler: nil)

So in your case:

if let url = URL(string: "tazah://posts?postID=10") {
        if UIApplication.shared.canOpenURL(url) {
            UIApplication.shared.open(url, options: [:], completionHandler: nil)
        }
    }
like image 172
kstefanou Avatar answered Sep 18 '25 11:09

kstefanou