Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to change the present view controller?
    primarykey
    data
    text
    <p>I have a login view controller which make a request to the server for authentification. Once it is success, I want the present view controller to be the home tab view controller of my application. I did try to use pushViewController:viewController or presentModalViewController or dismissModalViewControllerAnimated. Nothing works. You can take a look at the screenshot provided to understand my application flow.</p> <p>Here is some sample code:</p> <pre><code>- (IBAction)facebookLoginButtonClick:(id)sender { // get the app delegate so that we can access the session property AppDelegate *appDelegate = [[UIApplication sharedApplication]delegate]; // this button's job is to flip-flop the session from open to closed if (appDelegate.session.isOpen) { // if a user logs out explicitly, we delete any cached token information, and next // time they run the applicaiton they will be presented with log in UX again; most // users will simply close the app or switch away, without logging out; this will // cause the implicit cached-token login to occur on next launch of the application [appDelegate.session closeAndClearTokenInformation]; } else { if (appDelegate.session.state != FBSessionStateCreated) { // Create a new, logged out session. appDelegate.session = [[FBSession alloc] init]; } // if the session isn't open, let's open it now and present the login UX to the user [appDelegate.session openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) { // and here we make sure to update our UX according to the new session state [self dismissModalViewControllerAnimated:YES]; UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle: nil]; MainViewTabBarController *viewController = (MainViewTabBarController*)[mainStoryboard instantiateViewControllerWithIdentifier: @"mainPageTabBarId"]; [[self navigationController] presentModalViewController:viewController animated:YES]; }]; } </code></pre> <p>}</p> <p><img src="https://i.stack.imgur.com/e3nAm.png" alt="enter image description here"></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.
 

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