title: How to open a url in Safari from my Today Extension within my app using Swift
body: <p>I have a Today extension and let say I just want to open a url <code>let url = "https://google.com"</code> when I press the button <code>goButton</code> in my widget to open it in my app with safari ( inside my app using <code>SafariServices</code> )</p>
  
  <p>I have defined a custom url scheme in my Info.plist and I wrote those lines of code in my button (<code>class TodayViewController</code>) :</p>
  
  <pre><code>@IBAction func goButton(_ sender: Any) {
      let myAppUrl = URL(string: "Easy-tools://")!
      extensionContext?.open(myAppUrl, completionHandler: { (success) in
          if (!success) {
              print("error: failed to open app from Today Extension")
          }
      })
  }
  </code></pre>
  
  <p>I have sucssesfuly open my main app from my widget but i don't know how to open the url <code>let url = "https://google.com"</code> when i press <code>goButton</code> I have added this func in my AppDelegate file :</p>
  
  <pre><code>func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -&gt; Bool
  </code></pre>
  
  <p>but i don't know how to open it , by the way I'm new in swift </p>