carson-katri / carson-katri/router

Provide activeRoute Binding

Open
#4 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
23
Forks
0
PR merge metrics
No merged PRs in 30d

Description

This would, for instance, allow setting the `WindowGroup` title based on the current Route:

```swift
struct MyApp : App {
@State private var activeRoute: AppRoutes = .defaultRoute
var body: some Scene {
WindowGroup(title(for: activeRoute)) {
Router(activeRoute: $activeRoute) {
...
}
}
}
}
```
Can also open the possibility of navigating programmatically:

```swift
struct MyApp : App {
@State private var activeRoute: AppRoutes = .defaultRoute
var body: some Scene {
WindowGroup {
Router(activeRoute: $activeRoute) {
...
}
}.onOpenUrl {
activeRoute = ...
}
}
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the existing Router API and the SwiftUI WindowGroup usage shown in the issue. Trace how the current route is stored and propagated, then verify that the requested activeRoute binding supports title updates and programmatic changes through onOpenUrl.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.