Type Safely

Type Safely

Share this post

Type Safely
Type Safely
Store NavigateStack State Using An Enum With Associated Types

Store NavigateStack State Using An Enum With Associated Types

Daily Coding Tip 111

Millie Sturgeon's avatar
Millie Sturgeon
Jun 17, 2022
∙ Paid

Share this post

Type Safely
Type Safely
Store NavigateStack State Using An Enum With Associated Types
Share
Image by Quang NGUYEN DANG from Pixabay

This app starts pretty simply with a couple of Hashable and Identifiable structures.

It’s necessary that the Screen enum storing the navigation state is Hashable, as it’s required by the new initialiser for NavigationLink that I’ll use later. In order to be Hashable the associated values need to be Hashable as well…

Keep reading with a 7-day free trial

Subscribe to Type Safely to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Type Safely
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share