SwiftUI Cursor Rules

April 15, 2026

SwiftUI Cursor Rules

Best Practices

  • Use @State for local state
  • Use @Binding for two-way binding
  • Use @ObservedObject for reference types
  • Use @Environment for system values
  • Use MVVM architecture
  • Use @Published in ViewModels
  • Use ForEach for lists
  • Use NavigationStack for iOS 16+

AI Instructions

  • Use Swift 5.9+ features
  • Prefer @State over @ObservedObject
  • Include accessibility labels
  • Use preview providers
  • Add SwiftUI animations