Bahn-X / swift-composable-navigator

An open source library for building deep-linkable SwiftUI applications with composition, testing and ergonomics in mind
MIT License
580 stars 25 forks source link

Allow navigation via Screen objects #26

Closed ohitsdaniel closed 3 years ago

ohitsdaniel commented 3 years ago

Currently all navigation actions require an ID to navigate. As Screen Objects are hashable and therefore can be used as unique identifiers (or built in such a way that they are unique), let's add navigation via Screen objects.

Methods to be added: go<S: Screen, Parent: Screen>(to screen: S, on parent: Parent) go<Parent: Screen>(to path: [AnyScreen], on parent: Parent) dismiss<S: Screen>(screen: S) dismissSuccessor<Parent: Screen>(of parent: Parent)

ohitsdaniel commented 3 years ago

While working on this, I noticed goBack(to id: ScreenID) is missing and added it.