我尝试了以下代码,但只共享了文本和网址。我也使用了UIActivityItemSource,但这使用了文本或图像。有没有解决这些问题的工作?
var objectsToShare = [AnyObject]()
objectsToShare.append(self.postTitle!)
objectsToShare.append(self.postUrl!)
objectsToShare.append(self.postImage!)
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.excludedActivityTypes = [UIActivityTypeAirDrop, UIActivityTypeAddToReadingList]
presentationContext.presentViewController(activityVC, animated: true, completion: nil)