Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had a logout functionality in the app I did recently.</p> <p>I had a hierarchy as :</p> <pre><code> "BaseUITableViewController ^ | "Any subclass of UITAbleView Controller used in project." </code></pre> <p>all of these subclasses had a "Logout" button and the method to call logout service was written in Base class.</p> <p>as soon as the response for logout request is valid and the session is killed I call following method (which of your interest in contrast to the above text :))</p> <pre><code>-(void)gotoMainScreenOnLogout { self.navigationController.navigationBarHidden = YES;//to make the previous view invisible self.navigationController.toolbarHidden=YES; //27 JUNE UPDATE [self.view removeFromSuperview]; //27 JUNE UPDATE // MYAPPViewController *homeViewController = [[MYAPPViewController alloc]initWithNibName:@"MYAPPViewController" bundle:nil]; MYAPP_LoginUIVIewController *homeViewController =[[MYAPP_LoginUIVIewController alloc] initWithNibName:@"MYAPP_LoginUIVIewController" bundle:nil]; UINavigationController *nc = [[UINavigationController alloc]initWithRootViewController:homeViewController ]; [nc.navigationBar setBarStyle:UIBarStyleBlackOpaque]; // UIWindow *MYAPP_window = [[[UIApplication sharedApplication] windows]objectAtIndex:0]; CATransition *transition = [CATransition animation]; transition.duration = 0.8; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionMoveIn; transition.subtype = kCATransitionFade; transition.delegate = self; //... [MYAPP_window.layer addAnimation:transition forKey:nil]; [MYAPP_window removeAllSubviews]; // not needed anymore [MYAPP_window addSubview:nc.view]; [homeViewController release]; </code></pre> <p>}</p> <p>hope this helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload