title: How to disable swipe back specifically on only one view controller
body: <p>I know there have been similar questions asked, but none of them have worked for me.</p>
  
  <p>I have this code to enable swiping back in my project</p>
  
  <pre><code>    class InteractivePopRecognizer: NSObject {
  
      // MARK: - Properties
  
      fileprivate weak var navigationController: UINavigationController?
  
      // MARK: - Init
  
      init(controller: UINavigationController) {
          self.navigationController = controller
  
          super.init()
  
          self.navigationController?.interactivePopGestureRecognizer?.delegate = self
      }
  }
  
  extension InteractivePopRecognizer: UIGestureRecognizerDelegate {
      func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -&gt; Bool {
          return (navigationController?.viewControllers.count ?? 0) &gt; 1
      }
  
      // This is necessary because without it, subviews of your top controller can cancel out your gesture recognizer on the edge.
      func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -&gt; Bool {
          return true
      }
  }
  </code></pre>
  
  <p>I have this VC stack</p>
  
  <p>HomescreenVC -> Login/SignupVC -> UserProfileVC</p>
  
  <p>I do not want them to be able to swipe back from the UserProfileVC.</p>