全体の流れ
1.通常通りUIActivityViewControllerをセットする
2.iPadの場合はsourceViewと表示する位置(barButtonItemやsourceRect)をセットする
3.表示する
1.
NSString *text = @”これを送信します”;
NSArray* actItems = [NSArray arrayWithObjects:text, nil];
self.actCon=[[UIActivityViewController alloc]initWithActivityItems:actItems applicationActivities:nil];
2.
self.actCon.popoverPresentationController.sourceView = self.view;
self.actCon.popoverPresentationController.barButtonItem = self.navigationItem.rightBarButtonItem;
3.
[self presentViewController:self.actCon animated:YES completion:^{
}];
これはUIAlertControllerをiPadで使う場合も同じ。