使用UIActivityViewController swift 3/4分享Instagram图片有警报控制器错误

时间:2019-03-04 08:25:27

标签: ios swift image instagram uiactivityviewcontroller

我已使用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)

0 个答案:

没有答案