title: iPhone presenting and dismissing navigation view controller in storyboards?
body: <p>I have root view that presents navigation controller with content controller, this is how it looks like:
  <img src="https://i.stack.imgur.com/XCDdM.png" alt="enter image description here"></p>
  
  <p>NavigationController is presented modally, and ProjectTypeSelectionView is his root controller. When tapping logout button i want to dismiss modal view and return to LoginScreenViewController.</p>
  
  <p>So i set in prepareSegue LoginScreen as delegate:</p>
  
  <pre><code>- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  
   UINavigationController *destination = segue.destinationViewController;
  
   if ([[destination ] respondsToSelector:@selector(setDelegate:)]) {
       NSLog(@"%@", destination);
       [destination setValue:self forKey:@"delegate"];
  }
  }
  </code></pre>
  
  <p>and then inside ProjectTypeViewController add this method:</p>
  
  <pre><code> - (IBAction)logout:(id)sender {
        [self.delegate projectTypeSelectionViewControllerDidFinish];
   }
  </code></pre>
  
  <p>which is called when logout button is tapped. To my suprise this doesn't dismiss controller. Nothing happens, even thou everything is connected.</p>
  
  <p>I have traced error to this - when prepareSegue is called NavigationController's delagate is set to LoginScreenViewController, insetad of setting ProjectTypeController's delegate to LoginScreenViewController.</p>
  
  <p>How do i solve this properly? </p>