2

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];
Andrew Tetlaw
  • 2,669
  • 22
  • 27
TalkingCode
  • 13,407
  • 27
  • 102
  • 147

1 Answers1

2

I think this will answer your question: Different data for sharing providers in UIActivityViewController

Community
  • 1
  • 1
vedran
  • 1,145
  • 2
  • 13
  • 19