The first segue

We will learn how to create segues using the storyboard and how to trigger them using the code. Each segue is a relation (transition) between different screens in your app, and those transitions can be fired upon a user's action or by using any other trigger (time trigger, or an action from a server):

  1. The easiest way to create a segue is to hold Ctrl and then drag it from the view controller or button to the view controller, which should be presented on the screen. In our case, we can start with the home screen. Let's start a Ctrl drag from the Favorites button and then drop it on the next view controller (the favorites). The following screenshot shows what this should look like:
  1. Once you lift the mouse, a small popup ...

Get Learn Swift by Building Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.