Storyboards

A storyboard is a central place where all screens can be designed. It's not mandatory to use a storyboard to create a working iOS app, but with storyboards you can save a lot of time when defining a native UI. This is the official way of developing a UI in Apple's ecosystem of iOS, macOS, watchOS, and tvOS.

The storyboard editor is a special view of Xcode. It presents a visual editor for your application. Let's get back to our first empty app which has a single view. Do you remember that we had seen in the navigator that there is a special file named .storyboard? This is where we will start from and this is what your app renders initially:

Initial screen of your app

This screen is the initial screen of your app. The UI components which you can add can be found at the bottom-right of the Properties panel. Simply, drag and drop items on the canvas and they will appear.

The storyboard is a nice way to define complex visuals without code. It can be used to visualize the connections between different app screens (called scenes in the storyboard). This makes the app easily understandable by developers and the storyboard provides a nice overview of the whole app. Working with different UI components, such as table view and custom cell, renders completely easily. The Auto Layout, which we will discuss later in the Chapter 7, Developing a Simple Weather App, allows you to define mathematical relations between a component position and a component size, thus the view fits nicely on different phone screens. In storyboards, you can describe the transitions between different screens and the transition between scenes.

There is an easy way to hook interactions to many view components. We will discuss this later in this chapter. Let's first start by adding a few visual components. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.255.87