Petites vues, async/await pour les données, Dynamic Type et VoiceOver testés sur chaque écran.
Constitution — iOS app with SwiftUI
Version 1.0.0 · Ratified 2026-11-10
These principles hold for every spec, plan and task of the project. A spec may add rules; it never weakens these.
-
Small views. A view's
bodyfits on one screen and pieces are extracted into subviews. Views hold no business logic; it lives in@Observablemodels that are tested on their own. -
async/await for data. Networking and storage use async/await, started from the
.taskmodifier so work is cancelled when the view goes away. New code adds no completion handlers, and UI state changes on the@MainActor. -
Dynamic Type and VoiceOver on every screen. Text uses text styles, and every screen is checked at the largest accessibility size and with VoiceOver. Every control has an accessibility label, and a UI test runs
performAccessibilityAudit()on each screen. -
Previews for every view. Every view has a
#Previewwith sample data in light mode, dark mode and a large type size. A view that cannot be previewed has a dependency that should be injected. -
Strict concurrency. The project builds in the Swift 6 language mode with complete concurrency checking. A data race is a compile error, and
@unchecked Sendableneeds a reason in the review. -
One source of truth. Each piece of state has one owner:
@Statefor private view state,@Bindingto share it down and@Environmentfor dependencies. The same state stored in two places is a defect. -
Tested before merge. Models and services are covered with Swift Testing and the critical flows with XCUITest. The suite is green before the merge.
-
Private by default. Tokens and credentials live in the Keychain, the app ships a privacy manifest that matches what it collects, and there are no App Transport Security exceptions.