title: How to move from one viewcontroller to another in a storyboard using swift
body: <p>I am trying to move from SignInViewController to RegisterUserViewController on button click .Here is code</p>
  
  <pre><code>   @IBAction func RegisterNewAccountButtonTapped(_ sender: Any) {
           print("Register account button tapped")
          //RegisterUserViewController
  
  
         // let storyboard = UIStoryboard(name: "SignInViewController", bundle: nil)
          let vc = self.storyboard?.instantiateViewController(withIdentifier: "RegisterUserViewController") as! RegisterUserViewController
          self.present(vc, animated: true)
      }
  </code></pre>
  
  <p>Here in this picture are the class and storyboard id 
  <a href="https://i.stack.imgur.com/7aAaC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7aAaC.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/Tmrob.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tmrob.jpg" alt="enter image description here"></a>
  Here is error that is coming on pressing Register New Account button .</p>
  
  <pre><code>   2018-04-27 06:09:24.720143-0700 UserRegistrationExample[10193:1788611] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[&lt;UserRegistrationExample.RegisterUserViewController 0x7f84b4f171b0&gt; setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key repeatPasswordTextField.'
      *** First throw call stack:
      (
          0   CoreFoundation                      0x000000010db1826b __exceptionPreprocess + 171
          1   libobjc.A.dylib                     0x000000010a1fbf41 objc_exception_throw + 48
          2   CoreFoundation                      0x000000010db181b9 -[NSException raise] + 9
          3   Foundation                          0x0000000109c20883 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
          4   UIKit                               0x000000010a95dd56 -[UIViewController setValue:forKey:] + 87
          5   UIKit                               0x000000010ac3ac94 -[UIRuntimeOutletConnection connect] + 109
          6   CoreFoundation                      0x000000010dabb61d -[NSArray makeObjectsPerformSelector:] + 317
          7   UIKit                               0x000000010ac3964a -[UINib instantiateWithOwner:options:] + 1856
          8   UIKit                               0x000000010a964d49 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
          9   UIKit                               0x000000010a965652 -[UIViewController loadView] + 177
          10  UIKit                               0x000000010a965983 -[UIViewController loadViewIfRequired] + 195
          11  UIKit                               0x000000010a9661e0 -[UIViewController view] + 27
          12  UIKit                               0x000000010b3bd39d -[_UIFullscreenPresentationController _setPresentedViewController:] + 89
          13  UIKit                               0x000000010a936a8f -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 133
          14  UIKit                               0x000000010a979338 -[UIViewController _presentViewController:withAnimationController:completion:] + 3808
          15  UIKit                               0x000000010a97c14a __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 134
          16  UIKit                               0x000000010a97c5ea -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 532
          17  UIKit                               0x000000010a97c086 -[UIViewController presentViewController:animated:completion:] + 181
          18  UserRegistrationExample             0x00000001098e0ae5 _T023UserRegistrationExample20SignInViewControllerC30RegisterNewAccountButtonTappedyypF + 1077
          19  UserRegistrationExample             0x00000001098e0c58 _T023UserRegistrationExample20SignInViewControllerC30RegisterNewAccountButtonTappedyypFTo + 72
          20  UIKit                               0x000000010a7cd631 -[UIApplication sendAction:to:from:forEvent:] + 83
          21  UIKit                               0x000000010a942000 -[UIControl sendAction:to:forEvent:] + 67
          22  UIKit                               0x000000010a94231d -[UIControl _sendActionsForEvents:withEvent:] + 450
          23  UIKit                               0x000000010a94124a -[UIControl touchesEnded:withEvent:] + 618
          24  UIKit                               0x000000010a840bf1 -[UIWindow _sendTouchesForEvent:] + 2807
          25  UIKit                               0x000000010a842314 -[UIWindow sendEvent:] + 4124
          26  UIKit                               0x000000010a7e82da -[UIApplication sendEvent:] + 352
          27  UIKit                               0x000000010b0f6f18 __dispatchPreprocessedEventFromEventQueue + 2809
          28  UIKit                               0x000000010b0f9a7f __handleEventQueueInternal + 5957
          29  CoreFoundation                      0x000000010dabb351 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
          30  CoreFoundation                      0x000000010db5ad71 __CFRunLoopDoSource0 + 81
          31  CoreFoundation                      0x000000010da9fcb9 __CFRunLoopDoSources0 + 185
          32  CoreFoundation                      0x000000010da9f29f __CFRunLoopRun + 1279
          33  CoreFoundation                      0x000000010da9eb29 CFRunLoopRunSpecific + 409
          34  GraphicsServices                    0x00000001101af9c6 GSEventRunModal + 62
          35  UIKit                               0x000000010a7cb9a4 UIApplicationMain + 159
          36  UserRegistrationExample             0x00000001098deee7 main + 55
          37  libdyld.dylib                       0x000000010ec3a621 start + 1
      )
      libc++abi.dylib: terminating with uncaught exception of type NSException
  </code></pre>
  
  <p>I have visited the following links but non of them solved the problem</p>
  
  <p><a href="https://coderwall.com/p/cjuzng/swift-instantiate-a-view-controller-using-its-storyboard-name-in-xcode" rel="nofollow noreferrer">https://coderwall.com/p/cjuzng/swift-instantiate-a-view-controller-using-its-storyboard-name-in-xcode</a></p>
  
  <p><a href="https://stackoverflow.com/questions/17088057/instantiateviewcontrollerwithidentifier-storyboard-id-set-but-still-not-workin">instantiateViewControllerWithIdentifier - Storyboard id set but still not working</a></p>
  
  <p><a href="https://stackoverflow.com/questions/25326647/present-view-controller-in-storyboard-with-a-navigation-controller-swift">Present View Controller in Storyboard with a Navigation Controller - Swift</a></p>
  
  <p><a href="https://stackoverflow.com/questions/39776929/swift-3-xcode-8-instantiate-view-controller-is-not-working">Swift 3, Xcode 8 Instantiate View Controller is not working</a></p>
  
  <p><a href="https://stackoverflow.com/questions/24035984/instantiate-and-present-a-viewcontroller-in-swift">Instantiate and Present a viewController in Swift</a></p>
  
  <p>How to remove this error.</p>
  
  <p>You can download the code from this link 
  .<a href="https://drive.google.com/open?id=1yUaKeI6ZQphN7CsoiaeF2p4TmW_B5-9u" rel="nofollow noreferrer">https://drive.google.com/open?id=1yUaKeI6ZQphN7CsoiaeF2p4TmW_B5-9u</a></p>