prefer explicit apple apis Shipped
What this lens looks for
All UI code MUST use AppKit on macOS and UIKit on iOS; SwiftUI MUST appear only where Apple requires it, so flag SwiftUI used for ordinary app UI when an imperative AppKit/UIKit equivalent exists. The reasoning is that SwiftUI is a human-ergonomics convenience layer (less boilerplate, live previews, lower cognitive load) that an LLM gains nothing from, while AppKit/UIKit have 15+ years of training data, stable APIs, and explicit imperative patterns LLMs generate reliably; SwiftUI's API churn (NavigationView → NavigationStack, @ObservedObject → @Observable) causes version-specific generation errors, and its implicit behavior (modifier ordering, view diffing, opaque layout resolution) creates bugs agents struggle to diagnose; SwiftUI's iOS/macOS code sharing is a cross-platform compromise against the native-per-platform philosophy. On macOS expect explicit AppKit — NSTableView, NSSplitViewController, NSWindow, NSMenu, custom drawing via NSView.draw(_:) — for visible, predictable control over cell reuse, view recycling, responder chain, and rendering. On iOS expect explicit UIKit — UICollectionViewCompositionalLayout, UINavigationController, UITextView with TextKit 2, gesture recognizers, view controller containment — so every step is an explicit instruction. The only allowed SwiftUI surfaces are the ones Apple mandates: WidgetKit extensions (home screen and lock screen widgets), Live Activities and Dynamic Island presentations, and App Clips (where Apple strongly recommends SwiftUI). In those mandated surfaces the SwiftUI layer SHOULD be kept as thin as possible, pinning the minimum deployment target and avoiding deprecated APIs to reduce generation ambiguity.
What its verifier checks
All iOS UI is built with UIKit (lists/grids via UICollectionViewCompositionalLayout, navigation via UINavigationController, text via UITextView/TextKit 2, input via gesture recognizers and view controller containment) with no SwiftUI substitute; all macOS UI is built with AppKit (NSTableView, NSSplitViewController, NSWindow, NSMenu, custom NSView.draw(_:)) with no SwiftUI substitute; SwiftUI appears only in WidgetKit extensions, Live Activities/Dynamic Island, or App Clips and nowhere else; within those mandated SwiftUI surfaces the layer is kept thin, pins the minimum deployment target, and avoids deprecated APIs.