UIActivityViewController - delete all actions starting from com.apple.UIKit.activity.Open.Copy rawValue

I am trying to remove all types of activity from com.apple.UIKit.activity.Open.Copywith UIActivityViewController.

I tried to follow but didn't succeed, did anyone do this?

func showShareActivity(videoURL : NSURL, onComplete:@escaping (Bool, UIActivityType?, Error?)->()) {
    let activityVC = UIActivityViewController(activityItems: [videoURL], applicationActivities: nil)
    activityVC.excludedActivityTypes = [UIActivityType(rawValue: "com.apple.UIKit.activity.Open.Copy.*")]
    activityVC.completionWithItemsHandler = { (activity, success, items, error) in
            onComplete(success, activity, erro
       }
    appDelegate?.window.rootViewController?.present(activityVC, animated: true, completion: nil)
}

Note. . When I try to exclude one after another, it works, but I want to delete everything together (some of them I may not know). (Swift / ObjC any solution works.)

com.apple.UIKit.activity.Open.Copy.com.apple.iMovie com.apple.UIKit.activity.Open.Copy.com.apple.itunesu com.apple.UIKit.activity.Open.Copy.net.whatsapp.WhatsApp

Basically this is all that starts with text Import withor Copy to, see image below. enter image description here

I think the Evernote app does the same.

+4
source share

Source: https://habr.com/ru/post/1667992/


All Articles