ComposableNavigator released! Programmatic SwiftUI application based on navigation paths

Based on the experience we gathered on programmatic navigation in SwiftUI, we decided to build an open source library that enables rich deeplinking and navigation along navigation paths.

Welcome ComposableNavigator! :wave:

ComposableNavigator is based on a NavigationTree that defines all valid paths in your application. NavigationTree leverages ResultBuilder introduced alongside SwiftUI to enable a concise DSL for tree building.

struct AppNavigationTree: NavigationTree {
  let homeViewModel: HomeViewModel
  let detailViewModel: DetailViewModel
  let settingsViewModel: SettingsViewModel

  var builder: some PathBuilder {
    Screen(
      HomeScreen.self,
      content: {
        HomeView(viewModel: homeViewModel)
      },
      nesting: {
        DetailScreen.Builder(viewModel: detailViewModel),
        SettingsScreen.Builder(viewModel: settingsViewModel)
      }
    )
  }
}

navigationTree

Looking forward to feedback and contributions!

3 Likes
Terms of Service

Privacy Policy

Cookie Policy