Reputation: 13557
I have an UIActivityViewController
with 3 different types of activity items.
NSString
, UISimpleTextPrintFormatter
and UIImage
.
When I twitter, facebook or send as mail the system always adds the string and the image but when I print the system uses the UISimpleTextPrintFormatter
unless I remove it from the NSArray
. How can I tell the UIActivityViewController
to use the UIImage
for printing instead?
NSString *textToShare
= [NSString stringWithFormat:@"%@ %@ %i",
_car.make,_car.model, _car.constructionYear];
UISimpleTextPrintFormatter *textDataToShare
= [[UISimpleTextPrintFormatter alloc] initWithText:textToShare];
UIImage* imageToShare = [UIImage imageNamed:_car.picture];
NSArray* items = @[textToShare,imageToShare,textDataToShare];
UIActivityViewController *activityViewController
= [[UIActivityViewController alloc]
initWithActivityItems:items applicationActivities:nil];
Upvotes: 2
Views: 6678
Reputation: 1153
I think this will answer your question: Different data for sharing providers in UIActivityViewController
Upvotes: 2