我已使用swift 3/4在stackoverflow中进行搜索,以使用UIActivityViewController共享图像instagram。但是,当我要共享图像然后单击instagram徽标时,会出现警告消息:“很抱歉,出了点问题。请重试。是否有解决的办法?
let image = UIImage(named: "instaIcon.png")
let objectsToShare: [AnyObject] = [ image! ]
let activityViewController = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
activityViewController.popoverPresentationController?.sourceView = self.view
activityViewController.excludedActivityTypes = [ UIActivityType.airDrop, UIActivityType.postToFacebook, UIActivityType.addToReadingList, UIActivityType.assignToContact, UIActivityType.copyToPasteboard,
UIActivityType.mail, UIActivityType.markupAsPDF, UIActivityType.message, UIActivityType.openInIBooks,
UIActivityType.postToFacebook, UIActivityType.postToFlickr, UIActivityType.postToTencentWeibo,
UIActivityType.postToTwitter, UIActivityType.postToVimeo, UIActivityType.postToWeibo]
self.present(activityViewController, animated: true, completion: nil)