指定 UIActivityViewController 的接收者(分享 Sheet)?
Specify recipients of an UIActivityViewController (Share Sheet)?
我有一组从联系人列表中提取的联系人。我想获取这些联系人并将它们用作我的 UIActivityController
.
的收件人
var contactLocations = [URL]() // this should be filled with the contact URLs
let textToShare = "Hello, this is the link:"
var objectsToShare = [textToShare, url] as [Any]
objectsToShare.append(self.contactLocations)
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.popoverPresentationController?.sourceView = sender.customView
self.present(activityVC, animated: true, completion: nil)
您不能指定收件人,只能指定要与 UIActivityViewController 共享的数据。
我有一组从联系人列表中提取的联系人。我想获取这些联系人并将它们用作我的 UIActivityController
.
var contactLocations = [URL]() // this should be filled with the contact URLs
let textToShare = "Hello, this is the link:"
var objectsToShare = [textToShare, url] as [Any]
objectsToShare.append(self.contactLocations)
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityVC.popoverPresentationController?.sourceView = sender.customView
self.present(activityVC, animated: true, completion: nil)
您不能指定收件人,只能指定要与 UIActivityViewController 共享的数据。