Add runnable examples for DrMaxNavigation - #6
Open
lhoracek wants to merge 2 commits into
Open
Conversation
Adds an iOS app (DrMaxNavigationDemo.swiftpm) and a native macOS app (DrMaxNavigationDemoMac), both wrapping a shared demo package (DrMaxNavigationDemoCore) so the push/sheet/popover/cover navigation styles and feature composition via pullback(on:) can be tried interactively instead of just read about in the README. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
NavigationStack on macOS sizes navigationDestination content to its ideal size and doesn't paint an opaque background behind it, unlike UINavigationController on iOS. A destination that doesn't already fill and paint its own background (e.g. the Counter demo's plain VStack) renders small, centered, and see-through over the previous screen. Sheets/popovers already had the equivalent workaround via presentationBackground(.background); push was missing it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collaborator
Author
Collaborator
Author
DominikGrodl
reviewed
Sep 3, 2026
| public let controller = RootNavigationController<AppScreen>(root: .home) | ||
|
|
||
| private(set) var counterCoordinator: CounterCoordinator? | ||
| private(set) var settingsCoordinator: SettingsCoordinator? |
Contributor
There was a problem hiding this comment.
This seems wrong. If only one of them being shown is valid, it should be an enum.
Contributor
There was a problem hiding this comment.
Also this seems to me like it adds additional complexity to the example without really showcasing any of the library functionality, so I would drop this.
| public final class CounterCoordinator: Hashable { | ||
| let controller: NavigationController<AppScreen, CounterScreen> | ||
|
|
||
| private(set) var count = 0 |
Contributor
There was a problem hiding this comment.
Not sure what this count showcases as a library functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.










Summary
Examples/DrMaxNavigationDemo.swiftpm) and a native macOS app (Examples/DrMaxNavigationDemoMac) demonstrating the library.Examples/DrMaxNavigationDemoCore, consumed by both apps to avoid duplication.pullback(on:), matching the patterns described in the README..swiftpmiOS app does not open in Apple's separate Swift Playgrounds app (that app bundles an older, incompatible Swift toolchain).Test plan
xcodebuild build -scheme DrMaxNavigationDemo -destination 'platform=iOS Simulator,name=iPhone 17 Pro'succeedsswift build/ running the binary succeeds forDrMaxNavigationDemoMacswift teston the main package still passes (49/49), unaffected by these changes🤖 Generated with Claude Code