i want to implement the new ActivityViewController of iOS6, but i want to get rid of the unused activities like message, copy, sharing on weibo, etc..
Is it possible to customize or subclass it to remove those icons?
Thanks for your help!
Ok, i found a solution by myself to customize the UIActivityViewController:
if you want to get rid of sharing options like weibo, facebook, etc... its totally simple, just set the ExcludedActivityTypes property:
UIActivityViewController *actionCtrl = [[UIActivityViewController alloc]initWithActivityItems:act applicationActivities:nil];
[actionCtrl setExcludedActivityTypes:@[UIActivityTypeAssignToContact, UIActivityTypeCopyToPasteboard, UIActivityTypeMail, UIActivityTypePostToWeibo]];
[self presentViewController:actionCtrl animated:YES completion:nil];
If you want to add another Activity (button or image, etc.) you need so subclass the UIActivity and overwrite some methods like activityType and activityImage.
i.e.
- (UIImage *)activityImage {
return [UIImage imageNamed:@"icon"];
}
You this helps you guys too!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With