我有UIActivityViewController
3 种不同类型的活动项目。
NSString
,UISimpleTextPrintFormatter
和UIImage
.
当我在推特、脸书或作为邮件发送时,系统总是添加字符串和图像,但是当我打印系统时,UISimpleTextPrintFormatter
除非我从NSArray
. 我怎样才能告诉UIActivityViewController
使用UIImage
打印代替?
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];