You can add a completion handler on UIActivityViewController. In the completion handler, verify that the user is represented using the value completed. You probably want to do something like this:
func sharedShareAction(controller: UIViewController, sender: UIButton) {
controller.present(activityViewController,animated: true, completion: nil)
activityViewController.completionWithItemsHandler = { activity, completed, items, error in
if !completed {
return
}
IncreaseShareByOne()
}
}
Learn more about the docs API for more information.
toddg source
share