title: How can I pop specific View Controller in Swift
body: <p>I used the <code>Objective-C</code> code below to pop a specific <code>ViewController</code>.</p>
  
  <pre><code>for (UIViewController *controller in self.navigationController.viewControllers) {
      if ([controller isKindOfClass:[AnOldViewController class]]) { 
          //Do not forget to import AnOldViewController.h
          [self.navigationController popToViewController:controller
                                                animated:YES];
          break;
      }
  }
  </code></pre>
  
  <p>How can I do that in Swift?</p>