从uiactivtyviewcontroller IOS Swift中排除Instagram共享选项

时间:2017-02-07 11:35:09

标签: ios swift instagram sharing uiactivityviewcontroller

我目前正在开发一个项目,要求从UIActivtyViewController中删除Instagram共享选项,但我无法删除Instagram选项上的共享。 以下是我的代码

let img: UIImage = snapShot(button: button)
        let objectsToShare: [Any] = [img]
        let activityVC = UIActivityViewController(activityItems: objectsToShare, applicationActivities: nil)
        activityVC.excludedActivityTypes = [UIActivityType.postToInstagram]
        activityVC.completionWithItemsHandler = {(activityType: UIActivityType?, _ completed: Bool, _ returnedItems: [Any]?, _ activityError: Error?) -> Void in

       if completed {
          //my code 
       }
)}

我还有UIActivtyType

extension UIActivityType {
    @available(iOS 7.0, *)
    public static let postToInstagram: UIActivityType = {
        return UIActivityType.init(rawValue: "com.burbn.instagram.shareextension")
    }()
}

请有人指导我。 非常感谢:))

0 个答案:

没有答案