Skip to content
Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

Pinter Computing

Knowledge Base for IT Professionals, Teachers, and Astronauts

  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
  • Home
  • Programming
  • DevOps
  • Project Management
  • Software and Hardware
  • Miscellaneous
  • Egyebek
  • About
  • Experience
  • Education
  • Contact
Close

Search

Apple iOS development

Apple Objective-C programming fundamentals. Creating Segues in the Storyboard

By Laszlo Pinter
August 25, 2013 3 Min Read
0

Segue types

Segues are connections between views, so one view can call the other when the user pushes a button, or any specific object.

The Modal Segue

When the two views do not need to share information, like a login screen

The Push Segue

The push segue can pass data between the views and handle memory. This type of segue is needed for the navigation controller and tab bar controller.

 

Creating a Modal Segue

Add a button to the first view that will open the second view

  • In Xcode open the Storyboard of your application
  • Open the Utilities View in the upper right corner of the screen and select the Object libraryxcode object library
  • Drag a Text Field to the first view
  • Drag a Round Rect Button to the first view and enter Open Second Page as the title
    xcode first page

Add a new view to the Storyboard

  • From the Object library drag a View Controller to the storyboard
  • Drag a Text Field from the Object library to the second view
  • Drag a Round Rect Button from the Object library to the second view and enter Back to First Page to the title
    xcode second page

Create the segue between the views

  • Press the Control button on the keyboard and drag from the button on first view to the new view controller and release the control key and the mouse button
    xcode create segue
  • In the popup select modal
    xcode modal segue

 

Add the Text field to the interface of the first view

  • Open the ViewController.h of the new view in the Assistant Editor
  • Press the Control button and drag from the text field to the @interface section of the ViewController.h file
  • In the popup type firstTextField to the Name field and click the Connect button
    xcode first text field interface

Add the button to the interface of the first view

  • Press the Control key on the keyboard and drag the button from the first view to the @interface section of the ViewController.h file. Set the 
    • Connection to Action
    • Name to showSecondView: (including the colon)
    • Click the Connect button
      xcode first button interface

Create a a UIViewController class for the new View Controller

  • In the lower left corner of the project navigator click the plus sign (+)
  • Select New File... from the popup menu
  • On the popup window select Objective-C Class under IOS Cocoa Touch
  • Click the Next button
  • Set the name of the class to SecondViewController
  • Set the “Subclass of” to UIViewController
  • Click the Create button to place the new class into the project folder

Connect the new class to the View

  • Open the Storyboard and select the new view
  • In the Identity Inspector elect SecondViewController in the Class list

 

Add the Text field to the interface of the second view

  • Open the SecondViewController.h of the new view in the Assistant Editor
  • Press the Control button and drag from the text field to the @interface section of the SecondViewController.h file
  • In the popup type secondTextField to the Name field and click the Connect button
    xcode second text field interface

Add the button to the interface of the second view

  • Press the Control key on the keyboard and drag the button from the second view to the @interface section of the SecondViewController.h file. Set the
    • Connection to Action
    • Name to returnToFirstView: (including the colon)
    • Click the Connect button
      xcode second button interface

Tags:

iOSiPadiPhoneiPodXcode
Author

Laszlo Pinter

Follow Me
Other Articles
Previous

Apple Objective-C programming fundamentals – Part 1 – The language.

Next

Apple Objective-C programming fundamentals. Working with Dates

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Last Changes

  • Japan travel tips June 22, 2026
  • Argument of type '(number | null)[]' is not assignable to parameter of type '(err: Error, result: QueryResult) => void' June 20, 2026
  • Cities: Skylines II Developer Mode June 20, 2026
  • How to stop the rain and snow in Cities: Skylines II June 20, 2026
  • 'CSII_MANAGEDPATH' has incorrect path(s) when building Cities: Skylines II mod June 20, 2026

Tags

.NET .NETcore 3Dprinting ASP.NET Core AutodeskInventor AWS C# Chef cloud DevOps Docker EntityFramework Games Git Go iOS iPad iPhone iPod Java Kubernetes Linux MacOSX MSSQL MVC Node.js Packer PowerShell Python RDS RightScale Ruby security Splunk TeamCity Terraform TestKitchen Tomcat Ubuntu Vagrant VirtualBox VisualStudio Windows WordPress Xcode

Recent Comments

  • Zengei László on MyHeritage családfa exportálása és küldése emailben
  • Raúl Castillo on DynDns update error
  • MICHAEL on Windows Media Player 12 cannot find the album information
  • Nargis on Configure Epson ET-3850 scanning on Windows 11
  • Venczelné Zemen Erika on Delta S2302 termosztát programozása

–

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Copyright 2026 — Pinter Computing. All rights reserved.