Repository navigation
4.0.0
Scaffolding 4.0.0 makes routes explicit, returns typed child coordinators from navigation calls, and removes everything 3.x deprecated.
Route generation
- Declare routes with
@Route. A class-body function is a route only when it carries the attribute; nothing is inferred from its return type. - Return the concrete coordinator from a child route, alone or as a tab tuple's first element.
@Routeonany Coordinatableis a compile error that asks for the concrete type. - Report one error for a coordinator that declares no routes, and reject
@Routeoncustomize(_:)or on an unsupported return type. - Make a typed call as visible as its route function, capped at the coordinator's access, so a
publiccoordinator can route to an internal child. - Remove
@ScaffoldingIgnoredand@Scaffoldable(injectsCoordinator:). Unmarked functions are never routes, and every coordinator is injected into its views' environment.
Navigation
- Return the child from every call that reaches one:
route,present,setRoot,popToFirst,popToLast,selectFirstTab,selectLastTab,appendTab,insertTab,setDetail,setContent, andsetSidebar. A deep link chains without casts or type arguments. - Return
nilfrom a child route call when the request is skipped or nothing matches. View routes, and child routes inside#ifor marked@available, still returnSelf. - Add a tuple form of
awaiting:that hands back the child synchronously before the result is awaited. - Run a child route's factory when its destination is created instead of on first use. Tab and column children exist as soon as their container resolves.
Removed APIs
- Remove
expecting:and typed trailing closures from route-based calls.select(index:expecting:)andselect(id:expecting:)are unchanged. - Remove the
onDismiss:overloads,presentAndWait, androuteAndWaitin favor ofawaiting:. - Remove the configured
.sheet(...)factory,SheetConfiguration, anddestination.modalConfiguration.ModalPresentationTypeis.sheetor.fullScreenCover; apply the native presentation modifiers to the presented view. - Remove
replaceLast(with:),setRootTransitionAnimation(_:), the mode-lessrestoreNavigationState(from:),waitUntil(_:iterations:),resolveMeta(_:),environmentCoordinatable(_:), and the public coordinator and container wiring methods.
Package
- Resolve the DocC plugin only when
SCAFFOLDING_BUILD_DOCSis set, so consumers never download it. - Accept swift-syntax from 600 up to, but not including, 605.
Documentation and validation
- Added a 3.x to 4.0 migration guide and updated the DocC articles, agent guide, and skills for
@Routeand typed child routes. - Migrated the Checklist, Stinsen Parity, and Atlas examples. Routes that built either a tab shell or a split shell are now one route per shell.
- Added typed-route tests, macro expansion tests, and compile fixtures, and renamed the regression suites after their subject.
Migration
- Follow Migrating from 3.x to 4.0: mark every route, delete
@ScaffoldingIgnored, return concrete coordinators, then replaceexpecting:, the closure overloads, and the remaining removed calls. - Mark all routes of a coordinator in one pass. A half-migrated coordinator silently loses its unmarked routes, and the first sign is a missing
Destinationscase at a call site. - Split a route that built different coordinators into one route per coordinator and choose the route at the call site.
- Mark a route
publicto chain into its child from another module. - Keep route factories free of side effects, since they now run when the destination is created.
- Requirements and the snapshot schema are unchanged: Swift 6.2 / Xcode 26 and iOS 18, macOS 15, Mac Catalyst 18, tvOS 18, or watchOS 11. A route renamed during migration no longer decodes and is skipped with its children.