标签:ati sel pre bsp app equal har pat elf
NSArray*activityItems;
//IMAGE
if([strType isEqual:@"IMAGE"])
{
UIImage*imageToShare = _iv.image;
activityItems =@[imageToShare];
}else
{
NSURL*shareURL = [NSURL fileURLWithPath:strPDFURL];
activityItems =@[shareURL];
}
UIActivityViewController *avc = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
[self presentViewController:avc animated:YES completion:nil];
[avc setCompletionWithItemsHandler:^(NSString*__nullableactivityType,BOOL completed,NSArray*__nullablereturnedItems,NSError*__nullableactivityError){
if(completed) {
//分享成功
}else{
//分享失败
}
}
iOS UIActivityViewController分享
标签:ati sel pre bsp app equal har pat elf
原文地址:https://www.cnblogs.com/snbill/p/12268991.html