UIActivityViewController exclude all UIActivityCat

2019-05-04 21:10发布

问题:

I have instantiated a UIActivityViewController. Conveniently, I can exclude individual activity types using the property excludedActivityTypes.

I now want to exclude the activity category UIActivityCategoryAction. How can I exclude an activity category, as opposed to an individual activity type?

回答1:

As per current documentation, you can't but you could build an array holding all the individual types of an UIActivityCategory and pass it to the excludedActivityTypes property.

If you fear that over time Apple could add new activity types and your UIActivityViewController will show the new types, fear not because it will not happen unless you update the app using the new SDK. So you're safe in this regard.