If you want to open inside the app itself instead of leaving the app you can import SafariServices and work it out.
import UIKit
import SafariServices
let url = URL(string: "https://www.google.com")
let vc = SFSafariViewController(url: url!)
present(vc, animated: true, completion: nil)