iOS Basics StoryBoard Storyboard File
Directory:
1. The navigation features of the storyboard
2. Scene and segue in the storyboard
3. At the end of this article
In the previous HelloWorld project there was a Main.storyboard file, which was called a "storyboard" (Storyboard) file.
It can describe which interfaces are in the app, what controls are in the interface, and what their events are.
In addition, the storyboard can describe how the interface is navigated between.
1. The navigation features of the storyboard
In the case of multiple view controllers, it is convenient to use storyboard management, and storyboards can also describe the navigation relationships between interfaces.
Let's illustrate the usage of storyboards.
We are going to do an application like this: two different interfaces, with two tabs corresponding to each other, click on the label to achieve the two interface switching.
The application uses the tab bar Navigation mode, and the sketch of the design prototype is as follows:
Select the tabbed application template to create the project and open the Main.storyboard file in the generated project. We can see the Design view:
As you can see, the app contains two views, and two views have a toggle relationship.
Description
In some older versions of Xcode-created projects, you will often see the Xib file. In fact, xib and storyboards are very similar techniques.
So the story board and Xib comparison, is only the file suffix is different?
Of course not. In general, an engineering China year can have multiple xib files, one xib file for one view controller and multiple views. When using storyboards, a project requires only one main storyboard file.
2. Scene and segue in the storyboard
Scene and segue are two very important concepts in the storyboard. Each view controller will correspond to a scene ("Scene"), which can be understood as an interface or screen for an application, where there are many views or controls, which are equivalent to a xib.
Through the segue connection between these scenes, segue not only defines the way of jumping (or navigating) between scenes, but also reflects the relationship between scene.
The types of jumps are: Push, Modal, PopOver, and custom mode. Scene jump types are also used in conjunction with specific controllers.
Push is a tree navigation mode, modal is modal navigation mode, PopOver is to render a floating window, these navigation modes we will follow the detailed introduction.
In addition to scene and segue, there are some new things about table view cells in the storyboard, which we'll cover separately.
3. At the end of this article
There is no end to the feeling where the strange ...
iOS Basics StoryBoard Storyboard File