一、OC
//分享的标题
NSString *textToShare = @"分享的文字";//分享的图片
UIImage *imageToShare = [UIImage imageNamed:@"分享的图片"];
//分享的url
NSURL *urlToShare = [NSURL URLWithString:@"分享的url地址"];
//在这里呢 如果想分享图片 就把图片添加进去 文字什么的通上
NSArray *activityItems = @[textToShare,imageToShare, urlToShare];
UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
//不出现在活动项目
activityVC.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard,UIActivityTypeAssignToContact,UIActivityTypeSaveToCameraRoll];
[self presentViewController:activityVC animated:YES completion:nil];
// 分享之后的回调
activityVC.completionWithItemsHandler = ^(UIActivityType _Nullable activityType, BOOL completed, NSArray * _Nullable returnedItems, NSError * _Nullable activityError)