When i present an UIActivityController
using the code below i get, it is presented but the console shows "Warning: Attempt to present <UIActivityViewController: 0x7f8788e7aed0> on <MyApp.CustomTableViewController: 0x7f8788e3db60> which is already presenting (null)
".
@IBAction func shareImage(sender: AnyObject) {
let images: [UIImage] = [image.image!]
let activityViewController = UIActivityViewController(activityItems: images, applicationActivities: nil)
self.presentViewController(activityViewController, animated: true, completion: nil)
}
This func is called by an UILongPressGestureRecognizer
. Note that i'm using storyboard with the following hierarchy:
TabBarController
> (Relationship) > NavigationController
> (Relationship) > TableViewController
> (Show) > TableViewController
> (Show) > ViewController
.
The presentation happens on the last ViewController.
I'm quite sure it's about the hierarchy, which controller is currently presenting (and maybe how) and which controller is responsible for presenting the UIActivityViewController
.
EDIT
UILongPressGestureRecognizer
touch event is called multiple times which was causing the warning