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 9269243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:04:09+00:00 2026-06-18T15:04:09+00:00

I have a splitviewcontroller that would call a loginview controller if there’s a need

  • 0

I have a splitviewcontroller that would call a loginview controller if there’s a need for a login. This is how I would call the modal view

if([[NSUserDefaults standardUserDefaults] objectForKey:@"username"] == nil){
        [self performSegueWithIdentifier:@"LoginSegue" sender:self];
    }

This is how my storyboard looks like:

                                    --- uinavigation
                       - masterview |
uispliviewcontroller
                       - detailview |
                                    --- main dashboard view -(LoginSegue)--loginviewcontroller
                                             |
                                             |------ another viewcontroller

now I can get to the loginview without a problem and then I would try to dismiss the modal so it can go back to the maindashboard view using this

if([[NSUserDefaults standardUserDefaults] objectForKey:@"username"] != nil){

        [self dismissViewControllerAnimated:YES completion:nil];
    }

but it wouldn’t do anything.

Was wondering how I can properly dismiss that modal view that was called after login?

Any advice is very much appreciated.

Thanks!!!

  • 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-06-18T15:04:10+00:00Added an answer on June 18, 2026 at 3:04 pm

    For a login, a modal presentation might make more sense. Rather than connecting it with a segue, give the LoginViewController a Storyboard ID, like “LoginViewController”. (delete the segue to it, select the login vc in storyboard and find the storyboard id field in the identity inspector).

    Then, instead of performSegue, do this …

    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"LoginViewController"];
    [self presentViewController:vc animated:YES completion:^{}];
    

    Having done this, the dismiss will function as you expect it to.

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

Sidebar

Related Questions

I have added the split view controller on a view controller as this: rootViewController
I have created a split view application that begins with a modal view splash
I have a splitViewController that has a master and detail view controllers. The code
I basically have a splitview controller and immediately I would like to show a
I have a split view-based app that presents a master-detail interface, and uses a
NOTE: Before reading this question please note that I have read the previous questions
I'm trying to change the detail view in a splitViewController, i have the UIViewControllerHierarchyInconsistency
I have an application that starts with a Login screen (UIViewController) and then once
i have app with splitviewcontroller , in master view of splitview i have uitableview
I have an iPad SplitViewController application with the following features: master (left hand) view

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.