有人能建议我如何在Whatsapp或任何替代品上分享带有文本的图像吗?我已经尝试使用UIActivityViewController,但是可以同时在电子邮件中共享图像+文本,但不能在Whatsapp上。
将不胜感激。
代码如下:
let textToShare = "Hello world"
let myWebsite = NSURL(string:"https://www.apple.com/")
let img = UIImage(named:"BookImg")
let shareall = [img!,textToShare,myWebsite!] as [Any]
let vc = UIActivityViewController(activityItems: shareall, applicationActivities: nil)
vc.popoverPresentationController?.sourceView = self.view
self.present(vc, animated: true, completion: nil)