2

iOS16.4 Webview 不能用Safari调试

 11 months ago
source link: https://morganwang.cn/2023/04/14/iOS%2016.4Webview%E4%B8%8D%E8%83%BD%E7%94%A8%20Safari%20%E6%9F%A5%E7%9C%8B/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

iOS16.4 Webview 不能用Safari调试

2023-04-14

Xcode 升级到 14.3后,模拟器是iOS 16.4 的,想通过Safari -> Developer -> Web Inspector查看,结果发现查看不了

一开始以为是设置 Safari 中 Advanced没开启,去查看后,发现开关已开启。

搜索后发现,从 iOS16.4 之后,如果想要通过Web Inspector查看,需要设置如下代码:

if #available(iOS 16.4, *) {
webView.isInspectable = true
} else {
// Fallback on earlier versions
}

设置之后,重新运行,再通过 Safari 查看,就可以看到了。

扫一扫,分享到微信

微信分享二维码

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK