title: how to check if controller is already on navigationcontroller viewcontrollers stack?
body: <p>i'm getting this error:</p>
  
  <pre><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing the same view controller instance more than once is not supported
  </code></pre>
  
  <p>How does one check if a controller already exists in the stack and not push that controller but move to it?</p>
  
  <p>Here's some code where I'm pushing a controller based on a tab selection:</p>
  
  <pre><code>func tabSelected(tab: String) {
      switch tab{
      case "payment":
          mainNavigationController.popToViewController(myAccountViewController, animated: true)
      break
      case "delivery":
          mainNavigationController.pushViewController(deliveryViewController, animated: true)
          break
      case "service":
          mainNavigationController.pushViewController(serviceViewController, animated: true)
          break
      case "profile":
          mainNavigationController.pushViewController(profileViewController, animated: true)
          break
      default:
          break
      }
  }
  </code></pre>