Skip to content

fix for "share" button on ipad iOS9+ #148

Description

@zkrige

Crashes on ipad ios9+ if we dont set the UIPopoverPresentationController source

  • (void)actionButtonClicked:(UIBarButtonItem *)sender {
    NSArray *activities = @[[SVWebViewControllerActivitySafari new], [SVWebViewControllerActivityChrome new]];

    UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:@[self.self.webView.request.URL] applicationActivities:activities];
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    UIPopoverPresentationController *popPresenter = [activityController popoverPresentationController];
    popPresenter.barButtonItem = sender;

    }
    [self presentViewController:activityController animated:YES completion:nil];
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions