For an iPhone/iPad app, i have the functionality to share when someone clicks on UIBarButtonItem.
UIActivityViewController * activityVC = [[UIActivityViewController alloc] initWithActivityItems:shareItems applicationActivities:nil];
[self presentViewController:activityVC animated:YES completion:nil];
For iPad however, this code errors because I need to set the sourceView for the activityVC.
So I need to add this code, but set it to the position of UIBarButtonItem.
activityVC.popoverPresentationController.sourceView = SomeUIBarButtonItem;
But this doesn't work since UIBarButtonItem doesn't inherit from UIView(which is really strange for me and I don't get this logic).
Is there some way to set it so that share popover appears pointing the bar button item?
Thanks,
barButtonItem
property ofUIPopoverPresentationController
? – rmaddy