我有一个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];