0

I am trying experiment to open a url, the usual way, in a swift app. But this time it is not working. Maybe my url has something special.

Anyway, this is the URL I tried:

https://upload.wikimedia.org/wikipedia/commons/6/68/Hiragana_く_stroke_order_animation.gif

And this is the chunk of code I used:

    let myURLAdr = "https://upload.wikimedia.org/wikipedia/commons/6/68/Hiragana_く_stroke_order_animation.gif"

    if let url = URL(string: myURLAdr) {
        UIApplication.shared.open(url, options: [:],
                                  completionHandler: nil)
    } else {print("CANNOT OPEN!!!")}

I see:

CANNOT OPEN!!!

What am I doing wrong?

Or is there any perticular reason why it can't be opened?

Michel
  • 10,303
  • 17
  • 82
  • 179

0 Answers0