What is StoryBoard in iOS

Todo list online

Storyboard is a great tool for building your iOS app user interface. Select the Main_iPad storyboard in the project navigator. File and you will see several view controllers in the document overview (Split View Controller, Master View Controller and Detail View Controller). Each view controller in a storyboard file maintains a single one scene (a scene in this sense is really just a view controller).

On the iPad, you can use the Split View Controller or a popover controller to view multiple scenes on one screen. On the iPhone, you can usually only see one scene on a screen at a time. In the document outline, select the disclosure triangle next to the Master View Controller in the Master View Controller - Main Scene to expand the View Controller. ll see his view.

If you can't see the document outline, you can take control. You can also zoom in or out on a storyboard by double-clicking in the canvas of the storyboard or by using the zoom control. The = sign returns the full-size storyboard. This is the only way to edit views.

To add user interface elements, select the view you want to work with under the View Controller heading listed in the document outline.

It's about the view controller

Selecting a storyboard file in the project navigator starts the Interface Builder, the editor with which you edit the storyboard files for your application. Most applications only need a storyboard file, but since you have a Universal -App, you have two storyboards, one for the iPad user interface (Main_iPad. Storyboard) and one for the iPhone user interface (Main_iPhone. Storyboard).

Each storyboard file you create has its own Initial view controller, that serves as an entry point into the storyboard. In the main storyboard file of your application, the first view controller would be the first view controller that your application renders.

The view controller is the big kahuna here, and each view controller in a storyboard file manages a single scene. For iPhone applications, a scene manages the content of a screen. For iPad applications, however, content from multiple scenes can be displayed on the screen at the same time.

To add new scenes to your storyboard file, all you have to do is drag a view controller from the library onto the storyboard area and you can then display controls and other views (e.g. image, web, or even table views) to view of the view controller.

In addition to allowing you to build your application as a whole, storyboards also reduce the amount of code you have to write. Suppose you want to create a transition from one view controller to another. All you have to do is control-click a button or table view cell in one view controller and drag onto the other.

When you drag between view controllers, a -Segue that is displayed as a configurable object in the Interface Builder. Segues support all types of transitions available in UIKit such as navigation and modal transitions. You can also define custom transitions with a segue.

Using the Interface Builder to add the user elements

Xcode's Interface Builder lets you build a storyboard by graphically building your user interface in any view controller. Use the Interface Builder to design your app's user interface and save your work as a resource file that comes with your app and loads into your application at runtime.

This resource file is then used to automatically create your app's window and view controllers, as well as all of your views and controls.

If you don't want to use the Interface Builder, you can also build your objects programmatically. Create views and display controllers and even things like buttons and labels with your own application code.

How do you actually bring these little controls into the view that lives in the view controller scene? To do this, you use another area of ​​the workspace - the utility area.

You use the view selector in the toolbar to show or hide the utility area. The utility area is an optional area on the right side of the work area window. To hide or show the utility, click the Utility button in the view selector on the workspace toolbar.

When you move the mouse pointer over a toolbar button, a tooltip describes its function.

Check out the utility section in all its glory. The library area has been changed in size.

As you can see, this area contains two areas, the upper area for Quick Help and other inspectors (the Attribute Inspector is selected here) and the lower area for Resource Libraries.