I'm trying to segue to a view controller. the segue's identifier is "Orange" (the other view controller is just an orange view). The view controller is segued through storyboard and connected to an image view in my main view controller. I want to trigger this with a pan gesture recognizer. So when a pan is detected, it just segues to the view controller.
This is my attempt:
@IBOutlet var panGesture: UIPanGestureRecognizer!
@IBAction func onPan(sender: UIPanGestureRecognizer) {
if panGesture.state == .Ended {
print("panned")
performSegueWithIdentifier("Orange", sender: sender)
}
}
However, this is not working. I know it does detect the pan, but it doesn't perform the segue.
I read how to present the segue from IOS - How to segue programmatically using swift