Detect dismissal of UIActivityViewController

Swift 3 Version

avvc.completionWithItemsHandler = { (activityType, completed:Bool, returnedItems:[Any]?, error: Error?) in
   if completed {
      // Do something 
   }
}

[avvc setCompletionHandler:^(NSString *activityType, BOOL completed) {
    NSLog(@"after dismiss");
    //Present another VC
}];

Hope this help you.


Xamarin / C#

avvc.CompletionWithItemsHandler = MyCompletionWithItemsHandler;

// ...

void MyCompletionWithItemsHandler(NSString activityType, bool completed, NSExtensionItem[] returnedItems, NSError error)
{
    if (completed)
    {
        // Did not tap Cancel
    } 
    else
    {
        // Cancel was tapped
    }
}