How to indicate that a user UIActivitysupports a theme?
The documentation for the UIActivityItemSource protocol mentions that you can implement an additional selector activityViewController:subjectForActivityType:if you want the source to provide a Header:
When sending goods, the service can provide a separate subject field and data field, for example, an e-mail message. Add this method if you want to provide a subject field for services that support it.
But as far as I can tell, it is not documented anywhere, how can I actually indicate that my custom UIActivity supports the theme. How it's done?
Edit: To make my question clearer
Suppose I have a custom action item object, say DocumentActivityItemSourcethat implements the protocol UIActivityItemSource, and I have a custom UIActivityone that we can name SendWithFooMessageActivity.
Then I run the UIActivtyViewController:
NSArray *activityItems = @[[[DocumentActivityItemSource alloc] initWithDocument: document]];
NSArray *applicationActivities = @[[[SendWithFooMessageActivity alloc] init]];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:activityItems
applicationActivities:applicationActivities];
[parentViewController presentViewController:activityViewController
animated:YES
completion:nil];
Now in the pop-up window, select SendWithFooMessageActivity. Then, the activity controller will call activityViewController:itemForActivityType:on the instance DocumentActivityItemSourceto get the item, which will then be redirected to SendWithFooMessageActivityby calling this method prepareWithActivityItems:.
A normal activity element will be an image, line, or URL. In this case, let's say that it DocumentActivityItemSourcereturns a line with an outgoing advertising message about the document. It SendWithFooMessageActivitycan then use this text as the body of this foo-mail message.
Foo , . , UIActivityItemSource activityViewController:subjectForActivityType:, , .
Apple, , - activityViewController:subjectForActivityType: DocumentActivityItemSource, .
, , , SendWithFooMessageActivity ActivityCem? , ", []", - , .
, activityViewController:thumbnailImageForActivityType:suggestedSize:, ", ". ShareOnTwitter ShareOnFacebook , , , , . ?
, @chriszumberge, ActivityViewController , items:
[SendWithFooMessageActivity alloc] initWithSubject: document.title];
, UIActivityViewController.