How to exclude action activities from the UIActivityViewController?

1.3k views Asked by At

I am using a UIActivityViewController to share a invitation text to my app. I am trying to exclude all activities with the action category besides Notes App. I am unable to exclude "Save to Files" option.

  1. Is there any way to exclude the view with action activities directly?
  2. How can i exclude "Save to Files" activity option?

    @IBAction func inviteAction(_ sender: UIBarButtonItem) {
    let inviteText = "..."
    let actCont = UIActivityViewController(activityItems: [inviteText], applicationActivities: [])
    //Exclude action activities types from the list
    actCont.excludedActivityTypes = [ .print, .assignToContact, .saveToCameraRoll, .copyToPasteboard,
                                      .addToReadingList,
                                      UIActivityType(rawValue: "com.apple.mobilenotes.SharingExtension"),
                                      UIActivityType(rawValue: "com.apple.CloudDocsUI.AddToiCloudDrive")]
    self.present(actCont, animated: true, completion: nil)
    }
    
1

There are 1 answers

0
Catherine On

As of now, I think there is no way to exclude the " Save To Files" UIActivityType. Apple may do something for this in mere future