title: How to display Login and dismiss Settings - Storyboard
body: <p>I am trying to figure out how to display Login (modal viewcontroller) from logout button and automate dismiss Settings (modal viewcontroller) from underneath of Login. You may see the storyboard layout:</p>
  
  <p><a href="http://cl.ly/2B3h0T130S1K1026201N" rel="nofollow">http://cl.ly/2B3h0T130S1K1026201N</a></p>
  
  <p>I tried to add this code into logout method in SettingsViewController.m</p>
  
  <pre><code>- (IBAction)logoutAccount {
  
        [self dismissModalViewControllerAnimated:YES];
  
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
        UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
        [vc setModalPresentationStyle:UIModalPresentationFullScreen];
  
        [self presentModalViewController:vc animated:YES]; 
  
  } 
  </code></pre>
  
  <p>The problem is that it forced my app to freeze when I clicked to logout. Does anybody know what is wrong with it? Any suggestion appreciated.</p>