【发布时间】:2019-06-27 08:14:36
【问题描述】:
我使用以下代码在 WhatsApp 和 Mail 上分享了一些网址。
@objc func onclickOfShareButton(sender:UIButton){
let myWebsite = NSURL(string:"https://myDomain/path/\(String(zoomLocation.index))")
let shareAll = [myWebsite ?? []] as [Any]
activityViewController = UIActivityViewController(activityItems: shareAll, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
self.present(activityViewController, animated: true, completion: nil)
}
当我与 WhatsApp 分享时,我无法选择我需要分享的联系人。在某些情况下,一旦选择了联系人,我就无法单击下一步按钮。
它可以在某个时候共享,但如果失败也可以。一旦应用程序关闭并重新打开,它可以工作 2-3 次。
任何帮助将不胜感激。
【问题讨论】:
-
如果它有时能正常工作,那肯定是操作系统出了问题。选择 WhatsApp 联系人与您的代码无关。
-
@ojassethi。没有把握。但是如果我在新项目中推送这段代码,它就可以工作!使用 Xcode 10.1
标签: ios swift share uiactivityviewcontroller