Maulik shah
Maulik shah

Reputation: 1704

how to show only facebook,twitter and email in UIactivity viewcontroller in ios (objective c)?

I have an app I need to display only facebook,twitter and email in activityview controller?

everything need exclude.

How can I do that?

any help will be appreciated.

Upvotes: 0

Views: 1103

Answers (1)

norders
norders

Reputation: 1252

To exclude everything:

NSArray *exclude = @[UIActivityTypePostToFacebook,
                     UIActivityTypePostToTwitter,
                     UIActivityTypePostToWeibo,
                     UIActivityTypeMessage,
                     UIActivityTypeMail,
                     UIActivityTypePrint,
                     UIActivityTypeCopyToPasteboard,
                     UIActivityTypeAssignToContact,
                     UIActivityTypeSaveToCameraRoll,
                     UIActivityTypeAddToReadingList,
                     UIActivityTypePostToFlickr,
                     UIActivityTypePostToVimeo,
                     UIActivityTypePostToTencentWeibo,
                     UIActivityTypeAirDrop,
                     UIActivityTypeOpenInIBooks];

activityViewController.excludedActivityTypes = exclude;

Remove Facebook, Twitter and Mail from the list to show them in the action sheet.

Upvotes: 3

Related Questions