指定UIActivityViewController(共享表)的收件人?

时间:2017-07-22 16:35:29

标签: ios 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)

1 个答案:

答案 0 :(得分:2)

您无法指定收件人,只能指定要与UIActivityViewController共享的数据。