iOS只分享到微博的解决方法
程序员文章站
2022-03-04 20:30:46
...
很简单,利用iOS6的UIActivityViewController
- (IBAction)btn:(id)sender {
NSArray *activityItems = [[NSArray alloc]initWithObjects:@"分享内容",@"http://www.oschina.net/",[UIImage imageNamed:@"love.png"], nil];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
activityViewController.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypeMessage,
UIActivityTypeSaveToCameraRoll, UIActivityTypePrint,
UIActivityTypeCopyToPasteboard];
[self presentViewController:activityViewController animated:YES completion:NULL];
}
转载于:https://my.oschina.net/kevinvane/blog/136004