今天作为使用SFSafariViewController作为载入画面
其实这个使用非常的简单
只有两个步骤:
import SafariServices
// 实例化SafariViewController
// url的给予 记得要在www前面加上https://
let safariVC = SafariViewController(url:URL(string:"https://www.google.com)!)
// 跑出SafariViewController
present(safariVC, animated:true, completion:nil)
就这样可以大功告成了
附上我比较完整的程序码
因为我是用Static Cell作为我的呈现,所以不用再numberOfRowsInSection设定一大堆
override func numberOfSections(in tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 1
}
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 5
}
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch indexPath.row {
case 4:
let SafariWebView = SFSafariViewController(url: URL(string: "https://www.google.com")!)
present(SafariWebView, animated: true, completion: nil)
default:
break
}
}
成果展示:
>>: 【Day 11】- 再次创造 Ghost Process,这次找不到了吧哈哈(基於修改 PspCidTable 隐藏的 Rookit)
Node前端 今天来讲Vue前端的与postgres包入进docker,和後端编译後直接放入相比,前...
经过「安全」的硬碟部署,最後设置共享资料夹来「驱动」硬碟 确认unRaid Array启动後,转到 ...
进度条一般都是搭配文章使用, 主要是告诉使用者目前阅读到哪里~ 这是我自己非常喜欢的网页设计, 让你...
上一篇Day 29 - 开发流程(上) 瀑布式(Waterfall Model) & 敏捷式...