Modularised Navigation in SwiftUI — An Enum-based Approach

<p>In iOS 16, SwiftUI finally allows us to properly encapsulate navigation without being forced to pass a ton of bindings or using&nbsp;<code>NavigationLink</code>&nbsp;directly in UI.</p> <p>One thing that always introduces additional challenges, though, is modularisation.</p> <p>In a best-case scenario, every module functions independently and has zero dependencies on other modules (in the same layer).</p> <p>While it is possible to achieve that, there is always the need to navigate from one module to the other.</p> <p>One approach that elegantly solves this issue is the use of enums for internal and external navigation.</p> <p><a href="https://betterprogramming.pub/modularised-navigation-in-swiftui-an-enum-based-approach-13028acd01ae"><strong>Website</strong></a></p>