User Tools

Site Tools


ios-labs-s14:basics-ib

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ios-labs-s14:basics-ib [2014/02/12 20:32]
mbarboi created
ios-labs-s14:basics-ib [2014/02/17 13:42] (current)
mbarboi
Line 1: Line 1:
-What is a Storyboard?+=====InterfaceBuilder=====
  
-A storyboard is the visual representation of all the screens in an application. It also tells you about the transitions between various screens.+The tool used to create interfaces for iOS applications.
  
-A storyboard is represented as scenes ​and segues.+What You See Is What You Get, drag and drop system used to put views on controllers. Stores interface information in a **Storyboard** file.
  
-A scene refers to a single view or view controller. Each scene has a dock to make outlet and action connections between ​the view and its view controller.+**Storyboard**- file containing ​the visual representation of all the scenes, transitions, ​and relationships in an application. Opens InterfaceBuilder when selected.
  
-A segue manages the transition between two scenes. A segue is established by pressing ctrl key and dragging from one scene to the other. Pushing ​a view controller ​to the navigation stack and presenting a modal view controller on the click of a button can be done easily with the help of segue thereby reducing the need for coding.+**Scene**- refers ​to a single ​view controller and its associated views
  
-The entire application flow can be seen in the storyboard file.+**Segue**- transition between two scenes. Right-click + drag from a button to another view controller to establish.
  
-InterfaceBuilder (commonly abbreviated as IB) is Xcode'​s integrated interface-building tool. It is a WYSIWYG (what-you-see-is-what-you-get) editor that allows you to drag and drop Views onto the screen easily. One of the nicest features of Xcode, InterfaceBuilder allows you to deal with the View creation process without ever having to write single line of code. The file that InterfaceBuilder operates ​on is called ​the storyboard.+**Root View Controller**the first controller ​to appear in the context ​of the entire application OR UINavigationController. The first is represented by an arrow that points right with no tail on the left side. The second ​is an arrow between a navigation controller and another view controller, and can be set up by right-click+dragging from the navigation controller.
  
-IB can look a little complicated,​ but there are only a two broad kinds of items that appear ​on the screen.+===Connecting to Code=== 
 +Each rectangle ​on the screen ​represents a **View Controller** and contains all the information about the views of the controller.
  
 +No explicit connection exists between the views of the controller as stored in the storyboard file and the code that makes up the class.
  
 +At runtime, the class of the controller is instantiated and paired with the views of the class as built in InterfaceBuilder. In order to realize custom behavior, change the class of objects in the storyboard by using the **Identity Inspector.** This ensures the class you set is paired with the view you created.
  
-View Controllers- every long rectangle on the screen represents ​ViewControllerThese rectangles are the only things that can “float” in IB's main window +In order for controllers to call methods or change properties of views, they must have **references** to them. A reference is pointer to an objectIn order to connect a view to a controller, you must establish an **IBOutlet** or **IBAction**. The first of these is a variable, ​the second is a delegate method. 
-and 3. Arrows- arrows in IB represent relationships between ViewControllers. The arrow on the left of the image above identifies the first ViewController ​to appear when the app launchesArrows between ViewControllers are called segues and represent ​transition between ViewControllers+ 
 +  -IBOutlet- a variable created by right-click dragging from a view to the header file of its owner (usually a view controller)Must have assistant edit open with header file of appropriate class to connect. Can be public or private based on location inside or outside curly braces. 
 +  -IBAction- ​method created by right-click dragging from a button to header file of owning view controller. Must be public. Creates a method declaration and definition in target controller. Method is called when button is pressed. ​
ios-labs-s14/basics-ib.1392258779.txt.gz · Last modified: 2014/02/12 20:33 (external edit)