AXWebViewController icon indicating copy to clipboard operation
AXWebViewController copied to clipboard

iPad 上使用AXWebViewController 点击 actionBarButtonItem 按钮必崩溃。iOS 11

Open iodefog opened this issue 8 years ago • 2 comments

原因是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]; }

iodefog avatar Dec 21 '17 13:12 iodefog

@iodefog 已修改,新版本发布将会告知.

devedbox avatar Jan 13 '18 05:01 devedbox

v0.7.1已发布.

devedbox avatar Jan 16 '18 11:01 devedbox