0

我需要在 iOS 设备上打开一个.webarchive文件。我知道我可以使用 WKWebview 打开它:

let webPageRect = CGRect(x:0, y:0, width: 300, height: 800 )
let archiveView = WKWebView(frame: webPageRect )
addSubview( archiveView )
archiveView.load( testFile.webarchive, mimeType: UTType.webArchive.preferredMIMEType!, characterEncodingName: "utf-8", baseURL:URL( string:"about:blank" )!)

但理想情况下,我想使用SFSafariViewController打开文件,因为我不想重新创建浏览器的功能。

谢谢礼萨

4

0 回答 0