I am trying to use the UIActivityViewControllerCompletionHandler
, but i dont quite get how..
I want to detect when the user finishes or dismisses this view controller (UIActivityViewController
).
Anyone knows how?
I am trying to use the UIActivityViewControllerCompletionHandler
, but i dont quite get how..
I want to detect when the user finishes or dismisses this view controller (UIActivityViewController
).
Anyone knows how?
The second parameter of the completion handler tells you whether the user dismissed the controller. If they dismissed the controller,
completed
will be set toNO
.There's more details in the completion handler's documentation.
With iOS 8
completionHandler
is deprecated, so you will want to provide alternativecompletionWithItemsHandler
. It also allows to handle if extension modified data you set (say Photo extension). See DocumentationHere's how you show a sharing dialog and set its completion handler
For Swift, this one works for me...