From 9bea8bcbdf984da9d5944c7434e97c4c1e1d7e04 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Tue, 19 May 2020 08:21:44 -0400 Subject: [PATCH] Sheets need a source view on iPad. --- platform-darwin/Source/iOS/MPWebViewController.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform-darwin/Source/iOS/MPWebViewController.m b/platform-darwin/Source/iOS/MPWebViewController.m index 8c2095fa..833dc582 100644 --- a/platform-darwin/Source/iOS/MPWebViewController.m +++ b/platform-darwin/Source/iOS/MPWebViewController.m @@ -100,9 +100,10 @@ decisionHandler:(void ( ^ )(WKNavigationActionPolicy))decisionHandler { - (IBAction)action:(id)sender { - UIAlertController *controller = [UIAlertController new]; - controller.title = self.webView.URL.host; - controller.message = self.webView.URL.absoluteString; + UIAlertController *controller = [UIAlertController alertControllerWithTitle:self.webView.URL.host + message:self.webView.URL.absoluteString + preferredStyle:UIAlertControllerStyleActionSheet]; + [controller.popoverPresentationController setSourceView:sender]; [controller addAction:[UIAlertAction actionWithTitle:@"Safari" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { [UIApp openURL:self.webView.URL]; }]];