How would I provide a completely different set of data to each service in with a UIActivityViewController?
For instance:
You can provide different data for different activities by creating a class that adopts UIActivityItemSource protocol and implements the method:
-(id)activityViewController:itemForActivityType:
Then pass the object of your custom class to your UIActivityViewController in activityItems array with a call -(id)initWithActivityItems:applicationActivities:
From documentation of this method:
... Instead of actual data objects, the objects in this array can be objects that adopt the UIActivityItemSource protocol, such as UIActivityItemProvider objects. ...
Here is a tutorial about how to do that: https://www.albertopasca.it/whiletrue/objective-c-custom-uiactivityviewcontroller-icons-and-text/
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