【发布时间】:2016-09-24 11:16:29
【问题描述】:
我在与 SO iOS10 共享时遇到了一些问题。 我写了这段代码来选择一个活动并分享一个链接
@IBAction func shareAction(_ sender: AnyObject) {
let objectsToShare = ["Shared by: xxxxxx**strong text**", url]
let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
//New Excluded Activities Code
activityVC.excludedActivityTypes = [UIActivityType.airDrop, UIActivityType.addToReadingList]
if UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.phone {
self.present(activityVC, animated: true, completion: nil)
}else {
let popup: UIPopoverController = UIPopoverController(contentViewController: activityVC)
popup.present(from: CGRect(x: self.view.frame.size.width / 2, y: self.view.frame.size.height / 4, width: 0, height: 0), in: self.view, permittedArrowDirections: UIPopoverArrowDirection.any, animated: true)
}
}
在以前的版本中,打开了一个新的视图控制器来选择要共享的活动,但现在我看到了这个
No activity is shown
没人有这个问题吗?
谢谢大家...
【问题讨论】:
标签: ios share swift3 ios10 uiactivityviewcontroller