title: iOS App First Launch load T&C
body: <p>I would like some help to review my code. My intention is to display a view with T&amp;C when the app is first opened.</p>
  
  <p>I am currently using the following code under the FirstViewController, as suggested <a href="https://stackoverflow.com/questions/12878162/how-can-i-show-a-view-on-the-first-launch-only">here</a>:</p>
  
  <pre><code>- (void)viewDidLoad: (BOOL)animated
  {
      [super viewDidLoad];
  
      NSUserDefaults * standardUserDefaults = [NSUserDefaults standardUserDefaults];
  
      BOOL isAccepted = [standardUserDefaults boolForKey:@"iHaveAcceptedTheTerms"];
  
      if (!isAccepted) {
          [self presentViewController:@"Terms" animated:YES completion:nil];
      } else {
          [self.navigationController pushViewController:@"First" animated:YES];
      }
  </code></pre>
  
  <p>The reason why I used <code>@"Terms"</code> and <code>@"First"</code> is because otherwise it gives me error and also because I saw it suggested on a Youtube video, I am wrong?</p>
  
  <p>The other method I also tryed was the one suggested on the Youtube Video:</p>
  
  <pre><code>- (void)viewDidLoad: (BOOL)animated
  {
      [super viewDidLoad];
      if ([[NSUserDefaults standardUserDefaults] boolForKey:@"FirstLaunch"])
      {}
      else {
          // Place code here
  
  
          UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main_iPhone" bundle:nil];
          UIViewController *vc = [mainStoryboard instantiateViewControllerWithIdentifier:@"Terms"];
          [vc setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
  
  
          [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"FirstLaunch"];
          [[NSUserDefaults standardUserDefaults] synchronize];
      }
  </code></pre>
  
  <p>But neither work. Can you kindly share your thoughts and help me?</p>
  
  <p>Thanks :) </p>