Skip to content

Instantly share code, notes, and snippets.

@DonMag
Created October 7, 2016 17:48
Show Gist options
  • Select an option

  • Save DonMag/7d2b991567d89b8cb041228914b06bfb to your computer and use it in GitHub Desktop.

Select an option

Save DonMag/7d2b991567d89b8cb041228914b06bfb to your computer and use it in GitHub Desktop.
activityViewController.completionWithItemsHandler = {
(activityType, completed, items, error) in
guard completed else { print("User cancelled."); return }
print("Completed With Activity Type: \(activityType)")
if activityType == UIActivityTypePostToTwitter {
// do something
} else if activityType == UIActivityTypePostToFacebook {
// do something else
}
}
self.presentViewController(activityViewController, animated: true, completion: nil)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment