title: How to change the initial view controller through swift code
body: <p>I'm developing an app with initial view controller as "Navigation controller". The app contains 2 ideas to implement. </p>
  
  <p>1) From the RegisterViewController, User has to register the mobile no with verification //from sms or call, After verified it enters into HomeViewController( Condition: when the user install the app for the 1st time it shows the RegisterViewController)
  <a href="https://i.stack.imgur.com/QrFmB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QrFmB.png" alt="enter image description here"></a></p>
  
  <p>2) If the app is already get installed into the iPhone and the user also register the mobile no, then the user opens the same app now the initialViewController must be the HomeViewController</p>
  
  <p><a href="https://i.stack.imgur.com/yum72.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yum72.png" alt="enter image description here"></a></p>
  
  <p>How can I achieve this idea through swift code?</p>