Search code examples
iosswiftsharing

iOS Swift sharing PDF file, then delete


I have a question regarding sharing pdf files in swift. Sharing is quite simple and it already works in my app. I receive pdf file from backend, save it to local variable as bytes array, than save it in app cache directory and pass to UIActivityViewController.

Is there any way to receive some callback, that sharing action has been completed, or canceled, so I can immediately remove file from cache?

Thanks in advance for your help.


Solution

  • u could clean your cache when dismissing your UIActivityViewController