ios - SFSafariViewController 无法打开本地 html 文件
问题描述
我正在尝试SFSafariViewController
使用本地 html 打开,但它会导致崩溃。
let vc = SFSafariViewController(url: URL(fileURLWithPath: Bundle.main.path(forResource: "untitled", ofType: "html")!))
vc.delegate = self
self.present(vc, animated: true)
有没有办法做到这一点?调试时可以看到文件路径。
...../Devices/4980A022-975B-47D3-991B-C9741B06A5FB/data/Containers/Bundle/Application/22BFED43-49B2-4EB9-BAC3-BED26440BA52/xxxx-Internal.app/untitled.html
解决方案
推荐阅读
- python - 反转图
- javascript - 调用solidity函数来reactJS
- python - 如何在 django db 中存储多个模型对象
- mysql - 将更新触发器更改为在 MySQL 中插入触发器
- android-management-api - Android Management Api 跨档案联系人管理
- r - ggplot - 使用饼图以百分比形式可视化每组中的项目数 - R
- pandas - Pandas 中查询的奇怪行为
- c# - 如何在 ASP.NET Core Identity 2.0 中手动控制声称要添加到用户的角色
- scala - Scala:如果 Map 是从 GroupBy 创建的,为什么不能更改 Map 中的可变值
- shell - 如何在排序文件上使用 uniq-c