Type Safely

Type Safely

Store NavigateStack State Using An Enum With Associated Types

Daily Coding Tip 111

Millie Sturgeon's avatar
Millie Sturgeon
Jun 17, 2022
∙ Paid
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…

User's avatar

Continue reading this post for free, courtesy of Type Safely.

Or purchase a paid subscription.
© 2026 Type Safely · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture