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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:24:43+00:00 2026-06-12T08:24:43+00:00

I am brand new in Xcode and iOS development. I am trying to figure

  • 0

I am brand new in Xcode and iOS development.
I am trying to figure out how to open/show some view based on button click.
I know that I can do this using ctrl + mouse click on some ViewController using segue but I need to add some logic before.
How can I accomplish this?

  • 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-12T08:24:44+00:00Added an answer on June 12, 2026 at 8:24 am

    There are two ways to make segues work.

    You can either ctrl drag from a button to a new ViewController (like you have done) or you can ctrl drag from one ViewController to a new ViewController (drag from the little orange square icon in the bar underneath the VC).

    For both ways you can set an identifier on the segue that gets created. This is used to refer to it in the code.

    When you do the first way you are saying “When this button is pressed, move to this ViewController”. This means that whenever that button is pressed it will move to the new VC.

    The second way just tells the storyboard that there will be a segue to move to the new VC. To run it you would then add a IBAction to your button (instead of the segue).

    In the action for the button you then have…

    - (IBAction)buttonPressed:(id)sender
    {
        if (someConditionToCheckMoveToNewVC)
        {
            [self performSegueWithIdentifier:@"mySegue" sender:nil];
        }
    }
    

    This will then only perform that segue if the condition you have checked is true.

    You can also pass information to the new VC like so…

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        NewViewController *nvc = segue.destinationViewController;
    
        nvc.someProperty = @"blah";
    }
    

    this will then set the property in the new VC before transitioning to it.

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

Sidebar

Related Questions

Brand new to Cocoa and I'm trying to figure out how to copy an
In a brand new iOS project using Xcode 4.3.2, if a button has an
If I just start a brand new Single View App project on Xcode 4.3.2,
Using Xcode 4.3.2, starting a brand new Single View App, in ViewController's - (void)viewDidLoad
I am BRAND new to iOS development and am building my first app using
I created a brand new view-based project and added into the viewDidLoad - (void)viewDidLoad
I create a brand new Single View Application iPhone app in Xcode 4.2, it
I'm brand new with log4j and I can't seem to figure this out. If
I'm brand new to Prolog. I am simply trying to get some output from
I'm brand new to Objective-C. Right now, I'm about to C-based calls (open()) and

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.