Share content with specific app using only UIActivityViewController

I want to use UIActivityViewController to share my content, but only with some specific applications (Mail, email, Gmail, yahoomail). How can I share my content with email apps only. No other app needs to be viewed.

+3


source to share


1 answer


You can exclude all actions, but UIActivityTypeMail

:

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

      

and pass this array to your controller:



myActivityController.excludedActivityTypes = activitiesToExclude;

      

So you can keep active UIActivityTypeMail

.

+1


source







All Articles