I cannot figure out how to perform actions after the call UIActivityViewController
. For example, when I save an image with the following code:
let image = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
let activity = UIActivityViewController(activityItems: [image], applicationActivities: nil)
presentViewController(activity, animated: true, completion: nil)
The user receives a new window with the ability to save the image somewhere. After the image has been successfully saved, I want to perform some action (for example, go to the root controller). But I can’t figure out how to track that this one has UIActivityViewController
been closed. If I write code after this block, nothing happens, as I understand it, because this code is implemented in the VC action, and not in the original VC.
I thought viewWillDisappear
it would help me, but it keeps track of the original VC, from where I called the VC activity, and I cannot figure out how I can track the VC activity. At the same time, even if I had the opportunity to track this event, the question still remains: how can I distinguish a successful save from a cancel?
source
share