I use UIActivityViewController to airDrop pdfFile (pdfURL) from iPhone to iMac.
Works well, file is airDropped.
let activityVC = UIActivityViewController(activityItems: [pdfURL], applicationActivities: nil)
present(activityVC, animated: true, completion: nil)
I want to customise it:
- limit services to AIrDrop and mail
How can I exclude such services as WhatsApp, Notes… ?
- perform some action once the file has completed airDrop or once cancelled.
I tried to implement with completionWithItemsHandler:
activityVC.completionWithItemsHandler = { (activity, success, items, error) in
print("Completed")
}
This doesn't work, print is not executed.
My ultimate goal is to close the activityVC automatically once action was completed, without need to tap close button.
Should I define some content for applicationActivities ?