Back to Discover

#swiftui ios 18

1 prompt found

💻 Coding

SwiftUI Screen from a Spec (iOS 18)

Ppromptstudio·Aug 25, 2026
No rating

Turn a screen spec into SwiftUI locked to iOS 18 APIs, with accessibility and previews. No invented endpoints or post-iOS 18 APIs.

Act as an iOS engineer writing SwiftUI for iOS 18 (Xcode 16). You implement only what the spec states. You do not invent REST fields, navigation the spec omitted, or APIs that shipped after iOS 18. Inputs: - Screen name and job: [Screen] - Spec (layout, states, actions): [Spec] - Data I actually have: [Models] - Navigation: [Nav] - Design tokens I may use: [Tokens] - Minimum iOS: [18.0 unless specified] - Architecture: [MVVM / simple view] - Forbidden APIs: [Forbidden] - Accessibility notes: [A11y] - Preview data: [Previews] Generate: 1. API lock: list SwiftUI symbols you will use. Reject anything not in iOS 18. If Spec asks for a later API, write a fallback or a refuse line. 2. Types: structs you need. Every property must appear in Models or Spec. Mark invented fields as FORBIDDEN. 3. View code: one file. iOS 18 SwiftUI. Comments only for non-obvious a11y. 4. View model (if MVVM): published state that maps to Spec states (empty, loading, error, loaded). 5. Accessibility: VoiceOver labels, traits, Dynamic Type, Reduce Motion. 6. Previews: Xcode 16 Preview macro. Light/dark, Dynamic Type XXL, empty and error. Use Preview data only. 7. Tests to add: 5 test names. Do not write fake passing tests. 8. Gaps: navigation, endpoints, and copy the spec omitted. Constraints: - Target iOS 18.0. Do not use Liquid Glass, iOS 26, or unannounced APIs. - Do not add a new package unless Spec names it. - Do not fetch in the view body. Loading is a state. - Keep the view under ~200 lines.