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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:11:58+00:00 2026-06-09T03:11:58+00:00

I have two View Controllers, I need to have a button in ViewControllerOne that

  • 0

I have two View Controllers, I need to have a button in ViewControllerOne that when I press it Show me ViewControllerTwo.

In storyboard I related both views with a “Presenting Segues” – Push modal. And both views have a view controller class.

  • 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-09T03:12:00+00:00Added an answer on June 9, 2026 at 3:12 am

    I’m not sure what you mean by “I related both views with a ‘Presenting Segues’ – Push modal.” Are you using a navigation controller and want a push segue, or do you want to do a modal segue? A “push modal” is a contradiction in terms.

    So, let’s imagine that you want a modal segue. So, you put a button on the first view, right-click and drag (or control-click and drag) from that button to the second view.

    create segue 1

    You’ll get a pop up asking for type of segue. Select “modal”.

    create segue 2

    And you’re done transitioning from 1 to 2. No code necessary.

    If you want a button on the second view to take you back to the first view, you do not want a modal segue from the second view back to the first view, but rather you want to dismissViewControllerAnimated. You can do this via a custom segue, or easier, just have a button which calls dismissViewControllerAnimated. Thus, you’d add a button to the second view, and while the editor is in in “assistant” mode (where the associated .h file is showing below the interface builder; see below if you want to know how to show the .h file at the same time as the Interface Builder screen), right-click (or control-click) and drag from the button on the second view down to the second view controller’s .h file:

    dismiss 1

    By the way, if you don’t see the .h file there, click on the “assistant” editor button and choose “automatic” for the files to be shown down there, and you should be good:

    assistant editor

    It will then show you a pop up asking you what you want to do. Select IBAction and give your new method a name:

    dismiss 2

    Then go to your code for the view controller, and add the dismissViewControllerAnimated code:

    enter image description here

    All that code says (and in this example, I just called my IBAction dismissTwo) is:

    - (IBAction)dismissTwo:(id)sender
    {
        [self dismissViewControllerAnimated:YES completion:nil];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two view controllers in my storyboard and I need to push from
I have two view controllers in a tabbar which can both edit data. Therefore,
I have two view controllers that allow changes to the Address Book. The first
I have a partial view that is shared between two controllers and I'm trying
Need help with the following. I am creating two different combinations of view/controllers that
Hey guys I need some help with this: I have two view controllers, let's
I need your help please. I have two different view controllers: 1. with a
I have two view controllers name RootViewController and SecondViewController. In the FirstViewController I have
I have two view Controllers in my project ViewController , SettingsView . Here I
I have application where i have two view controllers my first view and second

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.