如何在UIActivityViewController中设置邮件主题? [英] How to set a mail Subject in UIActivityViewController?
问题描述
我想在 UIActivityViewController
中设置电子邮件共享主题,并且还想在Twitter中共享。我在Twitter上知道如果我们想分享 - 我们需要压缩文本到140个字符。我检查了许多SO解决方案,但没有任何工作。
I want to set subject for email sharing in UIActivityViewController
and also want to share in Twitter. I know in Twitter if we want to share — we need compress text to 140 chars. I checked many SO solutions, but nothing is working.
这个问题在最新的iOS版本中解决了吗?任何其他工作解决方案?
Is this issue fixed in latest iOS releases? Any other "working solutions"?
推荐答案
看起来好像emreoktem的解决方案发送 setValue:forKey:
到 UIActivityViewController
- 未记录。
It seems as though emreoktem's solution—sending setValue:forKey:
to the UIActivityViewController
—is undocumented.
在iOS 7及更高版本上,您可以在符合 UIActivityItemSource
协议的对象中实现 activityViewController:subjectForActivityType:
方法,以记录的方式执行此操作。
On iOS 7 and later, you can implement the activityViewController:subjectForActivityType:
method in an object conforming to the UIActivityItemSource
protocol to do this in a way that is documented.
这篇关于如何在UIActivityViewController中设置邮件主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!