我目前正在开发一个项目,要求从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")
}()
}
请有人指导我。 非常感谢:))