From swiftui
Enforces modern SwiftUI APIs and best practices like foregroundStyle(), clipShape(.rect), Tab API, and @Entry macro over deprecated patterns in code.
npx claudepluginhub fradser/dotclaude --plugin swiftuiswiftui-review/references/# Using modern SwiftUI API - Always use `foregroundStyle()` instead of `foregroundColor()`. - Always use `clipShape(.rect(cornerRadius:))` instead of `cornerRadius()`. - Always use the `Tab` API instead of `tabItem()`. - Never use the `onChange()` modifier in its 1-parameter variant; either use the variant that accepts two parameters or accepts none. - Do not use `GeometryReader` if a newer alternative works: `containerRelativeFrame()`, `visualEffect()`, or the `Layout` protocol. Flag `GeometryReader` usage and suggest the modern alternative. - When designing haptic effects, prefer using `...
/create-viewGenerates a SwiftUI view file with MVVM architecture, property wrappers, layouts, navigation elements, states, accessibility, dark mode support, previews, and documentation.
/convertConvert Claude-generated HTML design from URL or tarball path into SwiftUI View file in active Xcode workspace, with build, error fix, and preview diff.
/apiDesigns, implements, and applies best practices for REST or GraphQL APIs based on a required requirement and optional API type (rest or graphql).
/apiScaffolds production-ready FastAPI backend with auth (JWT/OAuth/apikey), database (Postgres/MySQL/Mongo/SQLite), OpenAPI docs, Docker, optional cache/messaging/monitoring.
Share bugs, ideas, or general feedback.
foregroundStyle() instead of foregroundColor().clipShape(.rect(cornerRadius:)) instead of cornerRadius().Tab API instead of tabItem().onChange() modifier in its 1-parameter variant; either use the variant that accepts two parameters or accepts none.GeometryReader if a newer alternative works: containerRelativeFrame(), visualEffect(), or the Layout protocol. Flag GeometryReader usage and suggest the modern alternative.sensoryFeedback() over older UIKit APIs such as UIImpactFeedbackGenerator.@Entry macro to define custom EnvironmentValues, FocusValues, Transaction, and ContainerValues keys. This replaces the legacy pattern of manually creating a type conforming to (for example) EnvironmentKey with a defaultValue, then extending EnvironmentValues with a computed property.overlay(alignment:content:) over the deprecated overlay(_:alignment:). For example, use .overlay { Text("Hello, world!") } rather than .overlay(Text("Hello, world!"))..navigationBarLeading and .navigationBarTrailing for toolbar item placement; they are deprecated. The correct, modern placements are .topBarLeading and .topBarTrailing.Text("^[\(people) person](inflect: true)") to show a number of people.Image(.avatar) rather than Image("avatar").WebView view type that replaces almost all uses of hand-wrapped WKWebView inside UIViewRepresentable. To use it, make sure to include import WebKit.ForEach over an enumerated() sequence should not convert to an array first. Use ForEach(items.enumerated(), id: \.element.id) directly..scrollIndicators(.hidden) rather than showsIndicators: false in the initializer.Text concatenation with +.For example, the usage of + here is bad and deprecated:
Text("Hello").foregroundStyle(.red)
+
Text("World").foregroundStyle(.blue)
Instead, use text interpolation like this:
let red = Text("Hello").foregroundStyle(.red)
let blue = Text("World").foregroundStyle(.blue)
Text("\(red)\(blue)")
If using ObservableObject is absolutely required – for example if you are trying to create a debouncer using a Combine publisher – you should always make sure import Combine is added. This was previously provided through SwiftUI, but that is no longer the case.