Form Pattern (SwiftUI)
Create a form that is typed, validated, accessible, and tested.
When to Use
- •When building any form or multi-step flow.
Inputs
- •Fields and validation rules
- •Submission behavior
- •Error and loading states
Instructions
- •Define a typed form model and validation rules.
- •Use
FormandSectionwith explicit labels. - •Map server errors to field-level errors.
- •Add XCTest coverage for validation logic.
Output
- •Form views and validation logic with tests.