title: Swipe gesture not working properly for side bar menu - Swift
body: <p>I am following this <a href="http://www.appcoda.com/sidebar-menu-swift/" rel="nofollow noreferrer">tutorial</a> to create a side bar menu. I was able to successfully implement it and it worked perfectly. But when I added multiple table view,s I noticed that when I go from View 1 to View 2 (see the story board below) and then come back to View 1, I can't use the swipe gesture to open the side menu. The tap function does work, I can tap on the menu button and the menu slides out.</p>
  
  <p>Below is the code that handles the swipe:</p>
  
  <pre><code>override func viewDidLoad() {
      super.viewDidLoad()
  
      if self.revealViewController() != nil {
          menuButton.target = self.revealViewController()
          menuButton.action = "revealToggle:"
          self.view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
      }
   }
  </code></pre>
  
  <p>When I swipe from left to right on the screen the above code produces the following result:</p>
  
  <p><a href="https://i.stack.imgur.com/AsdC7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AsdC7.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/KApON.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KApON.png" alt="enter image description here"></a></p>
  
  <p>Does anyone have any clue why this is happening? I did research but could not find anything.<br>
  If you need more information or if the question is not clear enough please let me know.</p>