changes to legacy webview function
This commit is contained in:
parent
54dd5351ed
commit
36367deff4
@ -175,13 +175,7 @@ extension WebView : WKNavigationDelegate {
|
||||
let url = navigationAction.request.url,
|
||||
let urlString = url.absoluteString.removingPercentEncoding,
|
||||
!urlString.contains("#") {
|
||||
MVMCoreDispatchUtility.performBlock(onMainThread: {
|
||||
// Presents standard webview.
|
||||
let safariViewController = SFSafariViewController(url: url)
|
||||
safariViewController.preferredBarTintColor = .white
|
||||
safariViewController.preferredControlTintColor = .black
|
||||
MVMCoreNavigationHandler.shared()?.present(safariViewController, animated: true)
|
||||
})
|
||||
MVMCoreUIActionHandler.shared()?.openURL(inWebView: url)
|
||||
decisionHandler(.cancel)
|
||||
} else {
|
||||
decisionHandler(.allow)
|
||||
|
||||
@ -27,6 +27,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
// Shows a topnotification new molecular
|
||||
- (void)topNotificationAction:(nullable NSDictionary *)actionInformation additionalData:(nullable NSDictionary *)additionalData delegateObject:(nullable DelegateObject *)delegateObject;
|
||||
|
||||
/// Legacy in app safari webview load
|
||||
- (void)openURLInWebView:(nonnull NSURL *)url;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
@import MVMCore.NSDictionary_MFConvenience;
|
||||
@import MVMCore.MVMCoreJSONConstants;
|
||||
@import MVMCore.MVMCoreCache;
|
||||
@import SafariServices;
|
||||
|
||||
@implementation MVMCoreUIActionHandler
|
||||
|
||||
@ -122,4 +123,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)openURLInWebView:(nonnull NSURL *)url {
|
||||
SFSafariViewController *safariViewController = [[SFSafariViewController alloc] initWithURL:url];
|
||||
safariViewController.preferredBarTintColor = [UIColor whiteColor];
|
||||
safariViewController.preferredControlTintColor = [UIColor blackColor];
|
||||
[[MVMCoreNavigationHandler sharedNavigationHandler] presentViewController:safariViewController animated:YES];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user