UIActivityViewController crashing on iOS 8 iPads

On iPad the activity view controller will be displayed as a popover using the new UIPopoverPresentationController, it requires that you specify an anchor point for the presentation of the popover using one of the three following properties:

In order to specify the anchor point you will need to obtain a reference to the UIActivityController’s UIPopoverPresentationController and set one of the properties as follows:

if ( [activityViewController respondsToSelector:@selector(popoverPresentationController)] ) { 
// iOS8
 activityViewController.popoverPresentationController.sourceView =
parentView;
 }

Leave a Comment