不想用webview?直接使用safari在app中打開網頁,並且超級簡單,只需兩步。web
不說廢話,直接開始,簡單粗暴bash
import SafariServices
複製代碼
func showSafariVC(for url: String){
guard let url = URL(string: url) else {
return
}
let safariVC = SFSafariViewController(url: url)
self.present(safariVC, animated: true, completion: nil)
}
複製代碼
就是如此簡單!!app