Hiding Your Action and Share Extensions In Your Own Apps
In PDF Viewer, we use a
UIActivityViewControllerto share PDFs. This means that our Action extension shows up in the list of actions as well! So a user would see an "Import to PDF Viewer" button inside PDF Viewer. There isn't an easily available API to prevent this from happening. However, the extension'sInfo.plistdoes haveNSExtensionActivationRuleinsideNSExtensionAttributes.[…]
The important bit is
AND NOT (ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "your.unique.uti.here"). This ensures that if theUIActivityViewControlleris created with any items matchingyour.unique.uti.here, your extension will not be displayed in the list of options. […] Next we need to add an item with a UTI matchingyour.unique.uti.hereto the items passed into theUIActivityViewController.