title: Disable swipe back gesture in Swift
body: <p>Been looking around on here for a while but can't seem to find a working solution.</p>
  
  <p>I'm trying to disable the swipe to go back to previous view gesture, in Swift.</p>
  
  <p>I've tried a variety of solutions including:</p>
  
  <pre><code>self.navigationController?.interactivePopGestureRecognizer.enabled = false
  </code></pre>
  
  <p>and</p>
  
  <pre><code>self.navigationController.interactivePopGestureRecognizer.delegate = self
  
  func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer!) -&gt; Bool {
      return false
  }
  </code></pre>
  
  <p>Is there a new method of doing this or some other method that works?</p>