Introduction

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

In the first two lessons of this module, you focused on hierarchical navigation. Hierarchical navigation gives users fewer initial options at the top of each view stack with a deeper structure underneath.

In the sample project, you began with a navigation structure. Tapping each option takes the user to that section with the appropriate information, such as a list of flights. Tapping a flight shows the user more information about that single flight. In a shopping app, you can start by showing the user categories, then display the products within a category, and then the details for each product.

You’ll find yourself adapting many apps to hierarchical navigation. This pattern is widespread because it works well for data that starts at a high level or general state and focuses with more detail on fewer items at each level.

Hierarchical navigation
Hierarchical navigation

Despite how often you’ll use it, hierarchical navigation has a few drawbacks. Due to the depth of each view stack, the user may have to backtrack through several layers of the navigation stack to find another view. It also makes it challenging to switch laterally between view stacks.

The other typical navigation structure uses a flat hierarchy. A flat navigational structure is best for moving between views that divide content into clear categories. The top-level view layout is broad and divided into multiple top-level views. Each view has less depth below the top view. This kind of navigational structure makes it easier for users to discover information because the path between the starting view and any view in the app is as short as possible.

Flat navigation
Flat navigation

But take care: too many categories, or indiscernible categories, can overwhelm the user. Simplify your app navigation by using a minimal number of tabs with concise titles or icons, aiming for up to five tabs in iOS. Check Apple’s guidelines for other tab bar best practices.

In SwiftUI, you use a TabView to implement a flat hierarchy. In this lesson, you’ll learn about TabViews and how to implement them in an app, as well as how to customize the tabs and show more information on each tab.

See forum comments
Download course materials from Github
Previous: Quiz: Hierarchical Navigation Structures Next: TabView in SwiftUI