title: How to find current visible viewController in iOS
body: <p>We know , if your viewController have been contain UINavigationController ,</p>
  
  <p>you can find your current visible view controller by 'self.navigationController.visibleViewController' .</p>
  
  <p>But I you present a view controller , how to find current visible controller ?</p>
  
  <h2>For Example :</h2>
  
  <pre><code>code one :
  ------
  AVClr *avclr = [[AVClr alloc]init] ;
  AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate ;
  appDelegate.window.rootViewController = avclr ;
  [avclr presentViewController:loginNavClr animated:YES completion:nil] ;
  </code></pre>
  
  <p>---> now , display <code>avclr</code></p>
  
  <pre><code>code two:
  ------
  AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate ;
  UIViewController *currentVisibleViewController = appDelegate.window.rootViewController ;
  BVClr *bvclr = [[BVClr alloc]init] ;
  [currentVisibleViewController presentViewController:bvclr animated:YES completion:nil] ;
  </code></pre>
  
  <p>---> now , display <code>bvclr</code></p>
  
  <pre><code>code three:
  ------
  AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate ;
  UIViewController *currentVisibleViewController = appDelegate.window.rootViewController ;
  CVClr *cvclr = [[CVClr alloc]init] ;
  [currentVisibleViewController presentViewController:cvclr animated:YES completion:nil] ;
  </code></pre>
  
  <p>---> Error , can not display <code>cvclr</code> , because <code>avclr</code> is a rootViewController and <code>avclr</code> present <code>bvclr</code> , so display <code>bvclr</code> .</p>
  
  <h2>Question:</h2>
  
  <p>But we know ,code three in another .m file , so we don't know who is the rootViewController . so If I present <code>cvclr</code> , the result is unexpect !</p>
  
  <p>In the circumstances ，how to display <code>cvclr</code> </p>