Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7691605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:39:49+00:00 2026-05-31T20:39:49+00:00

I need to present a modal view controller before showing a split view controller.

  • 0

I need to present a modal view controller before showing a split view controller. I need this because the user will have to log in.

I have read answers on this forum suggesting that the modal view controller should be presented from the AppDelegate but when trying to do so, nothing happens.

I have set up my view controller in the same storyboard as the rest of my interface is in and I have given the view controller the identifier loginViewController. I am trying to show the view controller in the AppDelegate like this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
        UISplitViewController *splitViewController = (UISplitViewController *) self.window.rootViewController;
        UINavigationController *navigationController = splitViewController.viewControllers.lastObject;
        splitViewController.delegate = (id) navigationController.topViewController;

        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPad" bundle:nil];
        LoginViewController *lvc = (LoginViewController *) [storyboard instantiateViewControllerWithIdentifier:@"loginViewController"];
        lvc.modalPresentationStyle = UIModalPresentationFullScreen;
        [splitViewController presentModalViewController:lvc animated:YES];
    }

    [_window makeKeyAndVisible];

    return YES;
}

When I do so, nothing happens. No errors, no modal view controller, no nothing. The application just shows my split view controller.

Can anybody tell me how I can show a modal view controller before showing the split view controller?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:39:50+00:00Added an answer on May 31, 2026 at 8:39 pm

    A viewcontroller will not allow to push/present on another viewcontroller unless and until the view is complete loading.

    Simply saying we are not allow to call presentModalViewController/pushViewController in a viewcontroller viewDidLoad/viewWillAppear. we need to call this in viewDidAppear.

    I had the same issue you said.

    Some Solution I can say are,

    Do the loading of LoginViewController after [self.window makeKeyAndVisible]; and in a performSelctor (may be with a delay).
    Move the code to display LoginViewController in SplitView’s DetailView controller viewDidAppear.

    thanks,

    Naveen Shan

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to present a modal view controller and be notified when it is
I need to present a modal tab bar controller using interface builder. I'd like
User is a model. I have 100 users. I need to present the list
I need to present some information in a table view where some information is
I have a small issue with the ZXingWidgetController , if I present the controller
On some occasions, not every time, when my app presents a modal view controller
I need to create a class that will present a UIVIew and has a
I want to present a Modal view in the middle of the screen in
At this present point in time I have some code that does the following:
I found this code to display a modal view: - (void)add:(id)sender { // Create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.