Skip to content

Commit 4ffd4aa

Browse files
author
Alexander Mokrushin
committed
Changed navigateToFile
1 parent a3c9c26 commit 4ffd4aa

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Sources/WebViewSDK/WebViewController.swift

+2-6
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ public class WebViewController: UIViewController, WKNavigationDelegate, WKUIDele
4949
}
5050
}
5151

52-
public func navigateToFile(url: URL) throws {
53-
if UIApplication.shared.canOpenURL(url) {
54-
webView.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent())
55-
} else {
56-
throw InvalidUrlError.runtimeError("Invalid File URL")
57-
}
52+
public func navigateToFile(url: URL) {
53+
webView.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent())
5854
}
5955

6056
public func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {

0 commit comments

Comments
 (0)