AXWebViewController is a webViewController to browse web content inside applications. It’s a lightweight controller on iOS platform based on WKWebView (UIWebView would be the base Kit under iOS 8.0). It added navigation tool bar to refresh, go back, go forward and so on. It support the navigation style on WeChat. It is a simple-using and convenient web view controller using inside applications.
原因是ipad上缺少 UIPopoverPresentationController
建议改成这样
(void)actionButtonClicked:(id)sender { NSArray activities = @[[NSClassFromString(@"AXWebViewControllerActivitySafari") new], [NSClassFromString(@"AXWebViewControllerActivityChrome") new]]; NSURL URL;
if AX_WEB_VIEW_CONTROLLER_USING_WEBKIT
URL = _webView.URL;
else
URL = _webView.request.URL;
endif
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:@[URL] applicationActivities:activities];
UIPopoverPresentationController *popover = activityController.popoverPresentationController; if (popover) { popover.sourceView = self.view; popover.sourceRect = CGRectMake(CGRectGetWidth(self.view.bounds)-400, 0, 200, 200); popover.permittedArrowDirections = UIPopoverArrowDirectionAny; }
[self presentViewController:activityController animated:YES completion:nil]; }