title: Swift prevent storyboard segue from happening
body: <p><strong>Intro</strong></p>
  
  <p>I am creating a <code>Swift 2.0</code> app in which an action can be performed only a certain number of times, say 8. In order to accomplish this behavior, I need to cancel a certain segue, <code>performAction</code>, should it be triggered via pressing a button linked to it on storyboard.</p>
  
  <p><strong>Research</strong></p>
  
  <p>I ran across questions like <a href="http://this" rel="nofollow">http://stackoverflow.com/questions/8066525/prevent-segue-in-prepareforsegue-method</a>, which suggested code like:</p>
  
  <pre><code>override func shouldPerformSegueWithIdentifier(identifier: String,sender: AnyObject?) -&gt; Bool {
  
       return true
   }
  </code></pre>
  
  <p><strong>Implementation</strong></p>
  
  <p>I implemented it like:</p>
  
  <pre><code>override func shouldPerformSegueWithIdentifier(identifier: "createCard" ,sender: AnyObject?) -&gt; Bool {
      if amountOfTimes &gt; 8 { //To be triggered if the segue should be cancelled
          return false
      } else {
      return true
      }
  }
  </code></pre>
  
  <p>However I get the error</p>
  
  <blockquote>
    <p>Expected ',' seperator</p>
  </blockquote>
  
  <p>How can I have the segue be cancelled should <code>amountOfTimes</code> be greater than 8?</p>