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

Both sides previous revision Previous revision
ios-labs-s14:basics-ib [2014/02/16 20:50]
mbarboi
ios-labs-s14:basics-ib [2014/02/17 13:42] (current)
mbarboi
Line 2: Line 2:
  
 The tool used to create interfaces for iOS applications. The tool used to create interfaces for iOS applications.
 +
 What You See Is What You Get, drag and drop system used to put views on controllers. Stores interface information in a **Storyboard** file. What You See Is What You Get, drag and drop system used to put views on controllers. Stores interface information in a **Storyboard** file.
  
Line 11: Line 12:
  
 **Root View Controller**- the first controller to appear in the context of the entire application OR a 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. **Root View Controller**- the first controller to appear in the context of the entire application OR a 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.
 +
 +===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.
 +
 +In order for controllers to call methods or change properties of views, they must have **references** to them. A reference is a pointer to an object. In 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.
 +
 +  -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- a 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.txt ยท Last modified: 2014/02/17 13:42 by mbarboi