Storyboard & Interface Builder
In order to save the time spent creating the user interfaces for iOS applications, the storyboard was initially introduced in iOS 5. It is a graphic depiction of an iOS application’s user interface. It may be described as the series of screens, each of which is a representation of the Views and the ViewController. A segue object, which symbolizes a transition between two ViewControllers, is required for transitions between two storyboard screens.
With the use of a visual editor that XCode provides, we can layout and create the application’s user interfaces by adding widgets from the media library, such as text fields, views, buttons, and table views, to the storyboard. A detailed explanation of each View will be provided later in the training.
Segues
In the storyboard, segues are utilized to create the transitions between two screens. We have the option to force the segue or set the transition type like the model. Put simply, a segue is an arrow that is defined on an object, like as a button or ViewController, such that any user event that occurs on the object will cause the transition that the segue defines to occur.
The transition between two ViewControllers utilizing Segue is depicted in the following figure.
We might occasionally need to transfer data between ViewControllers. The prepareForSegue method, which is called on the View Controller when the segue is triggered, can be used to accomplish this. The performSegue(withIdentifier: String) method on ViewController can be used to execute the segue programmatically, or it can be executed on the tap of the object on which the segue is defined.