Sharing via UIActivityViewController to Twitter/Facebook etc. causing crash

后端 未结 5 1188
野的像风
野的像风 2020-12-06 02:10

On iOS8 I\'m using a UIActivityViewController to share a UIImage to Facebook/Twitter etc. It seemed to be working fine, but today it suddenly started crashing when running t

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-06 03:01

    As @mmccomb told here, on iPad the activity view controller will be displayed as a popover using the new UIPopoverPresentationController. You need to specify at least the source view:

    activityViewController.popoverPresentationController.sourceView = YOURDESIREDVIEW;
    

    If you want to show the popover anchored to any point to that view, specify it with the sourceRect property of the popoverPresentationController.

提交回复
热议问题