I am using UIActivityViewController
to display options. Then select Twitter or Facebook, it appears iOS share sheet.
Is there any way to dismiss share sheet manually? I cant see any delegate to this.
Here is my code:
let arrObjectsToShare = [self, finalTextToShare, secondActivityItem]
let activityVC = UIActivityViewController(activityItems: arrObjectsToShare, applicationActivities: nil)
activityVC.excludedActivityTypes = [
UIActivityTypePostToWeibo,....etc]
activityVC.completionWithItemsHandler = {(activityType: String?, bool: Bool, dictType: [AnyObject]?, error: NSError?) -> Void in
print(activityType)
}
self.presentViewController(activityVC, animated: true, completion: nil)
Mention: When iOS share sheet is up to screen, keyboard is shown also. I tried to dismiss keyboard, at least, But no way:
self.view.endEditing(true)
Really need help with this. Thanks
If iOS Share Sheet
is displayed, and call this method:
self.dismissViewControllerAnimated(true, completion: nil)
share sheet is dismissed successfully.