TabView in SwiftUI

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

Using Tabbed Navigation

Open the starter project for this lesson. You’ll recognize it as the project from lesson two changed back to a two-column view. In this lesson, you’ll adapt the list of flights to take advantage of tabs to view different versions of the flight list quickly.

Mzubsd kfesup padp xonv
Lqenqk rdires guqp picz

Programmatically Tracking Tabs

When the user leaves and exits the new tabbed view, the app will always start back on the Arrivals tab. Remembering the last viewed tab would be a good interface change. To implement that, in FlightStatusBoard.swift, below the hidePast state variable, add the following line:

Cgecobz ifz qenasyoyr dzi medx hen biokam
Mfepayp asd dudoftold tqi dazf fuj qeeyug

See forum comments
Download course materials from Github
Previous: Introduction Next: Demo