title: Triggered Segue of Swipe Gesture Canceling IBAction
body: <p>I had a swipe gesture in a view controller working working perfectly and reporting to the output. Something simple like this: </p>
  
  <pre><code> @IBAction func leftSwipe(sender: UISwipeGestureRecognizer) {
      println("ok") 
  }
  </code></pre>
  
  <p>But then I took that same gesture recognizer and attached a segue to it that would cause it to modally switch view controllers when the swipe was detected. I did that all in storyboard with a simple control click, drag the gesture recognizer to the view controller I want to change to, and select one of the segue animation options. It worked as expected and when I swipe the view controller changes to another one, but... the IBAction stopped working completely, I even used a breakpoint and it never breaks there. Do triggered segues cancel out other sent actions normally? I could always add another gesture recognizer but is this behavior normal? </p>
  
  <p>Small update: 
  Adding a new gesture recognizer worked and it can be recognized with an IBAction but now the previous gesture does not work and the view controller does not change.</p>
  
  <p>SOLUTION: 
  Thanks to Firas for pointing me in the right direction, I found the method prepareForSegue explained by apple <a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIViewController_Class/index.html#//apple_ref/occ/instm/UIViewController/prepareForSegue:sender:" rel="nofollow">here</a>
  I implemented the method in the view controller that is sending the segue like this:</p>
  
  <pre><code> override func  prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
      if segue.identifier == "yourSegueID" {
          println("segue happened, so the gesture did too!")
      }
  }
  </code></pre>
  
  <p>Maybe there could be problems with associating the segue with the gesture like that but for my implementation I can't really see anything that could happen. </p>