Skip to content
CAI
Software that uses CAICheck a score

pointfreeco/swift-navigation

59.3

Adequate · 1 October 2026

12.7k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Swift Navigation is a modular library that provides declarative navigation, state management, and UI bindings for iOS, macOS, tvOS, and watchOS applications. It supports both SwiftUI and UIKit ecosystems, offering features like enum-case navigation, two-way control bindings, and configurable animations. The system is designed to be lightweight through optional feature traits and includes comprehensive test coverage for its core navigation and binding behaviors.

How it got here

2021 — Swift Navigation 2.0 modular architecture

8 changes.

The project underwent a major restructuring to version 2.0, introducing a modular architecture with a core SwiftNavigation library and platform-specific extensions. This release modernized APIs by replacing legacy unwrapping patterns with binding-based approaches and deprecated older SwiftUI views in favor of NavigationStack. The update also enforced stricter safety for alert actions and upgraded dependencies to support Swift 6 and modern state management macros.

2024–2026 — UIKit and AppKit navigation support

19 changes.

This period focused on extending the Swift Navigation library to support UIKit and AppKit platforms, introducing declarative navigation, two-way data bindings for UI controls, and platform-specific animation systems. The work included building comprehensive case studies, integrating with CasePaths for enum-based navigation, and establishing robust test coverage across all new modules.

Features

Add SwiftUI representables for AppKit views with disabled perception tracking

Introduces \NSViewControllerRepresenting\ and \NSViewRepresenting\ structs in \Sources/AppKitNavigation/SwiftUI/Representable.swift\ to wrap AppKit view controllers and views within SwiftUI. These wrappers are designed to facilitate rendering previews of AppKit components on macOS 13 and earlier where the \\#Preview\ macro is unavailable. A key behavioral detail is that the initialization of the wrapped AppKit components is executed via \skippingPerceptionChecking\, effectively disabling perception tracking for these specific UI representations.

Sources/AppKitNavigation/SwiftUI · high confidence

Add SwiftUI representables for UIKit views and view controllers

Introduces \UIViewControllerRepresenting\ and \UIViewRepresenting\ in the \UIKitNavigation/SwiftUI\ module, allowing UIKit view controllers and views to be wrapped as SwiftUI views. These wrappers are designed to facilitate rendering previews in iOS 16 and earlier where the \\#Preview\ macro is unavailable, and they explicitly disable perception tracking during initialization to ensure correct behavior.

Sources/UIKitNavigation/SwiftUI · high confidence

Added Wi-Fi Settings case study with network connection and management flows

The Wi-Fi Settings case study now includes a complete set of UIKit views for managing Wi-Fi networks. Users can toggle Wi-Fi on/off, view a list of available networks with signal strength and security indicators, and tap a secured network to enter a password and connect. Once connected, tapping the network opens a detail view where users can choose to forget the network, triggering a confirmation alert. The feature uses \UIKitNavigation\ for presenting the connection sheet and navigating to the detail view, demonstrating complex state management and navigation patterns within a collection view.

Examples/CaseStudies/UIKit/WiFiFeature · high confidence

Introduce AppKit animation support for navigation state changes

This change adds AppKit-specific animation capabilities to the navigation library, allowing developers to control how view transitions animate on macOS. It introduces the \AppKitAnimation\ type, which wraps \NSAnimationContext\ to provide duration, timing functions (such as linear, ease-in, and ease-out), and speed modifiers that align with SwiftUI's animation API. The \UITransaction\ extension now includes an \appKit\ property to attach these animations to state changes, and the \UIBinding\ extension provides an \animation\ modifier to specify animations when binding values change. This enables smooth, configurable visual transitions for AppKit-based navigation flows.

Sources/AppKitNavigation · high confidence

Introduce UIKit Navigation with declarative push, present, and dismiss capabilities

This release adds the \UIKitNavigation\ module, providing SwiftUI-like declarative navigation for UIKit apps. It introduces \NavigationStackController\ to manage navigation paths via bindings, \UITraitCollection.push\ for programmatic stack updates, and \UIViewController.present\ for modal presentations with \onDismiss\ callbacks. The module also includes \UIAlertController\ initializers that accept \AlertState\ and \ConfirmationDialogState\ data models, automatically handling button roles and adding a default 'OK' button when no buttons are specified.

Sources/UIKitNavigation/Navigation · high confidence

Introduce UIKit-specific navigation and animation support

This change adds a new \UIKitNavigation\ module that bridges Swift Navigation's transaction and binding system to UIKit. It introduces \UIKitAnimation\ to define and perform animations (including iOS 4, 7, and 17 styles) and \UITransaction\ to associate these animations with state changes. Users can now use the \.animation()\ modifier on \UIBinding\ to specify UIKit animations for state updates and use \withUIKitAnimation\ to execute closures with specific animation contexts, enabling smooth visual transitions in UIKit-based views driven by Swift Navigation state.

Sources/UIKitNavigation · high confidence

Introduce declarative navigation state types and SwiftUI binding utilities

This change adds new model types for managing UI navigation state, including \AlertState\, \ConfirmationDialogState\, \ButtonState\, and \TextState\, which allow developers to define alerts and dialogs in their business logic for easier testing and separation of concerns. It also introduces a \bind\ view modifier to synchronize model state with view state (such as focus bindings) and adds \CaseBindable\ support for exhaustive switching over enum case bindings via dynamic member lookup.

Sources/SwiftNavigation · high confidence

New UIKit case studies for navigation, bindings, and observation

The UIKit case studies now include comprehensive examples for driving navigation via optional and enum-based state (BasicsNavigationViewController, ConciseEnumNavigationViewController), managing form controls with @CaseBindable (EnumControlsViewController), handling text field focus state (FocusViewController), and demonstrating minimal observation and animations (MinimalObservationViewController, AnimationsViewController). Additionally, type-safe and type-erased stack navigation patterns are showcased via StaticNavigationStackController and ErasedNavigationStackController, while UIControlBindingsViewController illustrates binding various UIKit controls to observable models.

Examples/CaseStudies/UIKit · high confidence

New UIKit control bindings for two-way data synchronization

This update introduces new binding extensions for a range of UIKit controls, enabling two-way synchronization between UI state and application data. The changes add support for UIColorWell, UIDatePicker, UIPageControl, UISegmentedControl, UISlider, UIStepper, UISwitch, and UITextField (including attributed text and selection). A foundational extension for UIControl provides the underlying binding mechanism, while a specific implementation for UITabBarController allows binding to the selected tab by identifier. These bindings are available on iOS 14+ (with some features requiring iOS 17+ or Swift 6) and are conditionally compiled to support the new Perception trait.

Sources/UIKitNavigation/Bindings · high confidence

New internal infrastructure for SwiftUI and UIKit case studies

This change introduces a new internal framework for displaying and managing case studies within the examples project. It adds \CaseStudy.swift\, which defines protocols and view builders to support both SwiftUI and UIKit-based case studies, including navigation links, sheet presentations, and an 'About' modal for reading documentation. It also includes \DetentsHelper.swift\ for configuring sheet presentation styles, \Text+Template.swift\ for parsing simple markdown-like syntax in case study descriptions, and moves \FactClient.swift\ into the internal folder while simplifying its \id\ property to use an \Int\ instead of \AnyHashable\.

Examples/CaseStudies/Internal · high confidence

Support for enum-case bindings via CasePaths integration

The library now integrates with the CasePaths library to allow navigation bindings to be driven directly by enum cases. By adding the CasePaths trait, users can use dynamic member subscripts on enum bindings to extract or set associated values, enabling simpler navigation logic for state models that use enums to represent different destinations or states.

Sources/SwiftUINavigation/Traits · high confidence

Behavioural changes

Deprecate alert and confirmationDialog bindings that ignore actions

The library now requires explicit action handlers for alert and confirmation dialog state bindings. Using \.alert($state)\ or \.confirmationDialog($state)\ without a trailing closure is deprecated; users must provide an action handler (e.g., \.alert(state) { \_ in }\) to ensure actions are not silently ignored. This change improves safety by preventing accidental loss of user interaction data.

Sources/SwiftUINavigation/Internal · high confidence

Examples project restructured with new case studies and framework support

The Examples project has been reorganized to include a new CaseStudies app and an updated Inventory app, which was renamed and upgraded from the previous SwiftUINavigation scheme. The project now supports additional frameworks including UIKitNavigation, AppKitNavigation, and SwiftNavigation, and incorporates new source files for UI components, tests, and utilities. This change reflects a broader effort to modernize the examples with Observation and Swift Testing support, providing developers with updated reference implementations for navigation, alerts, and other UI patterns.

Examples/Examples.xcodeproj · high confidence

Internal concurrency helpers and deprecation scaffolding

This update introduces several internal utilities to support Swift concurrency and navigation state management, including \AnyHashableSendable\ for hashable sendable values, \LockIsolated\ for thread-safe value isolation, and \AssumeIsolated\ to safely assume main actor execution on older Swift versions. It also adds \HashableStaticString\ and \ToOptionalUnit\ helpers, and establishes a deprecation layer in \Deprecations.swift\ that aliases \ObservationToken\ to \ObserveToken\ and marks legacy \AlertState\, \ButtonState\, and \ConfirmationDialogState\ initializers as deprecated in favor of new builder-style APIs.

Sources/SwiftNavigation/Internal · high confidence

Migrate case studies to SwiftUI NavigationStack and remove legacy optional-driven navigation examples

The case study examples have been updated to use the modern SwiftUI \NavigationStack\ instead of the deprecated \NavigationView\, and the specific case studies demonstrating optional-driven alerts, confirmation dialogs, sheets, popovers, full-screen covers, and navigation links have been removed. The root view now simply links to consolidated \SwiftUICaseStudiesView\ and \UIKitCaseStudiesView\ entries, reflecting a shift away from the library's older \unwrapping:\-based presentation APIs in favor of current SwiftUI navigation patterns.

Examples/CaseStudies · high confidence

Modernizes SwiftUI state management and navigation patterns

The Inventory example has been updated to use the new \@Observable\ macro for view models, replacing the older \ObservableObject\ and \@Published\ properties. Navigation and presentation logic now leverages modern SwiftUI APIs such as \NavigationStack\, \navigationDestination\, and \sheet(item:)\, moving away from the legacy \SwiftUINavigation\ library's \NavigationLink\ and \sheet(unwrapping:)\ helpers. Additionally, the app structure now uses \@main\ with a dedicated \AppModel\ and \Preview\ macros for testing.

Examples/Inventory · high confidence

Swift Navigation library restructured with Swift 6 support and optional traits

The project has been renamed from SwiftUI Navigation to Swift Navigation and restructured to support Swift 6 language mode via dedicated package manifests ([e-mail redacted], [e-mail redacted], [e-mail redacted]). The library now uses Swift Package Manager traits to make dependencies like CasePaths, CustomDump, IssueReporting, Perception, and Sharing optional, allowing users to include only the features they need. The core SwiftNavigation library provides foundational tools such as observe and UIBinding, while platform-specific libraries (SwiftUINavigation, UIKitNavigation, AppKitNavigation) are built on top of it. The package also adds an .editorconfig for consistent code formatting and updates the CI configuration to test across iOS, macOS, tvOS, and watchOS platforms.

(repo-wide) · high confidence

SwiftUI navigation and presentation APIs modernized with binding-based APIs and deprecated legacy views

The \SwiftUINavigation\ module has been refactored to provide modern, binding-driven APIs for alerts, confirmation dialogs, and navigation destinations, replacing the previous \unwrapping:\ pattern with an \item:\ parameter that accepts a binding to an optional value. This change eliminates invalid runtime states (such as \isPresented\ being true while data is nil) and allows titles to be dynamically computed from the alert or dialog data. New \alert(\:)\ and \confirmationDialog(\:)\ overloads now support \AlertState\ and \ConfirmationDialogState\ types directly, while legacy \Alert\ and \ActionSheet\ initializers are deprecated in favor of the new \View\ extensions. Additionally, \navigationDestination\ now supports passing a binding to the unwrapped item, enabling two-way data flow for destinations like compose views. Legacy helper views \IfLet\, \IfCaseLet\, and \Switch\ have been removed, and \WithState\ is deprecated in favor of SwiftUI's \@Previewable\ macro.

Sources/SwiftUINavigation · high confidence

UIKit view controller lifecycle hooks via method swizzling

The library now injects custom \onDismiss\ and \onViewAppear\ callbacks into \UIViewController\ instances using Objective-C method swizzling. This allows users to attach side effects that trigger reliably when a view controller is dismissed or appears, with specific handling for \UIAlertController\ to ensure the dismissal callback executes on the main queue after the action sheet's internal state is processed.

Sources/UIKitNavigationShim · high confidence

Xcode workspace restructured with updated schemes and build configurations

The Xcode workspace has been reorganized to support a multi-target build environment. Scheme files have been migrated from the Swift Package Manager directory to the workspace, upgraded to Xcode 16 format, and renamed to reflect the new target names (e.g., SwiftUINavigation to SwiftNavigation). The main scheme now includes build entries for SwiftNavigation, AppKitNavigation, and UIKitNavigation targets, and test actions have been updated to use explicit test plan references instead of inline testable definitions.

SwiftNavigation.xcworkspace · high confidence

Test coverage

Added internal test utilities for async assertions and UI setup; Added macro tests for @CaseBindable and @UITransactionEntry; Added test coverage for SwiftUI navigation alerts, bindings, and case paths; Added test coverage for UIKitNavigation bindings and memory management; Added test suite for SwiftNavigation features; Added test suite for UIKit navigation behaviors.

Dependencies

Swift Navigation 2.0: New modular architecture, platform upgrades, and optional traits

This release restructures the library into a modular architecture with a new core \SwiftNavigation\ product and separate \UIKitNavigation\ and \AppKitNavigation\ libraries, replacing the previous \SwiftUINavigation\-centric design. It raises the minimum supported platforms to iOS 15, macOS 12, tvOS 15, and watchOS 9, and updates the Swift tools version to 6.4. The package now supports optional feature traits—CasePaths, CustomDump, IssueReporting, Perception, and Sharing—which allow users to include only the dependencies they need. Under the hood, dependencies have been updated to their latest major versions, including swift-case-paths 1.10.0, swift-perception 2.0.10, and swift-issue-reporting 2.1.0.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 60 → 59 (-0.7)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 94 → 93 (-0.2)
  • Architecture 98 → 99 (+1.3)
  • Maturity 56 → 56 (-0.1)
  • Readiness 54 → 55 (+0.7)
  • Security 53 → 53 (+0.0)

Resolved (5)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (7 lines × 4) (Sources/UIKitNavigation/Bindings/UIPageControl.swift)
  • Hotspot: Sources/SwiftNavigation/TextState.swift (Sources/SwiftNavigation/TextState.swift)
  • Off-boarding risk: anonymized user #1

New (10)

  • Ambiguous constructor parameter type. Both AppKitAnimation and UIKitAnimation have an initializer taking a parameter of type Animation. In Swift, Animation is a common type name (often from SwiftUI). It is unclear if this refers to the same type, a platform-specific type, or if the library intends to bridge SwiftUI's Animation to both. If Animation is a shared type, the constructors are consistent; if they are distinct platform types with the same name, it creates confusion. Given the context of AppKitAnimation and UIKitAnimation being separate wrappers, this likely implies a shared Animation type, but the naming is potentially confusing against the platform-specific wrappers.
  • Coverage not measured — Swift suite
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • Dependency not covered by the committed resolution: swift-sharing
  • Duplicated block (9 lines × 2) (Examples/CaseStudies/SwiftUI/EnumNavigation.swift)
  • Duplicated block (9 lines × 2) (Examples/CaseStudies/SwiftUI/EnumNavigation.swift)
  • Floating branch dependency: swift-case-paths
  • Inconsistent animation API surface between AppKit and UIKit. AppKit provides a single, high-level animate method that abstracts timing functions. UIKit provides three distinct animate overloads with different signatures (standard, spring, and spring-specific duration), forcing the user to choose the specific UIKit animation type explicitly rather than using a unified abstraction.
  • Off-boarding risk: anonymized user #1
  • TextState.customDumpValue (cyclomatic 39) (Sources/SwiftNavigation/TextState.swift)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

pointfreeco/swift-navigation was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 7e95e5e9ff0a64f6ad8bca59083f8d6ba381b6ff — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.