title: XCode: Adding password protection to an existing ios app
body: <p>I have a huge tabbed bar application which uses storyboards and is already on the app store - but now I am adding in password protection to it. </p>
  
  <p>I have already implemented a settings page in my app in which the user can toggle whether or not a password is required. They can also change their password here.</p>
  
  <p>However, I can't find a solution to the next stage. Here is some code from my App Delegate:</p>
  
  <pre><code>-(void)requestPassword {
      NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
      NSString *passwordON = [defaults objectForKey:@"passwordBOOL"];
      if ([passwordON isEqualToString:@"ON"]) {
          NSLog(@"ON");
      }
      else {
          NSLog(@"Off");
      }
  }
  </code></pre>
  
  <p>As you can see, I am detecting whether or not the password is on or off. If the password is on, how do I go to a different view or set up an overlay password entry view? I am not sure if I should have a separate view for this or run some code from the first view of my app. </p>
  
  <p>Any suggestions are greatly appreciated!</p>