Install
1
Run in your terminal$
npx claudepluginhub fradser/dotclaude --plugin swiftuiDetails
Namespace
swiftui-review/references/Command Content
Using modern SwiftUI API
- Always use
foregroundStyle()instead offoregroundColor(). - Always use
clipShape(.rect(cornerRadius:))instead ofcornerRadius(). - Always use the
TabAPI instead oftabItem(). - Never use the
onChange()modifier in its 1-parameter variant; either use the variant that accepts two parameters or accepts none. - Do not use
GeometryReaderif a newer alternative works:containerRelativeFrame(),visualEffect(), or theLayoutprotocol. FlagGeometryReaderusage and suggest the modern alternative. - When designing haptic effects, prefer using
sensoryFeedback()over older UIKit APIs such asUIImpactFeedbackGenerator. - Use the
@Entrymacro to define customEnvironmentValues,FocusValues,Transaction, andContainerValueskeys. This replaces the legacy pattern of manually creating a type conforming to (for example)EnvironmentKeywith adefaultValue, then extendingEnvironmentValueswith a computed property. - Strongly prefer
overlay(alignment:content:)over the deprecatedoverlay(_:alignment:). For example, use.overlay { Text("Hello, world!") }rather than.overlay(Text("Hello, world!")). - Never use
.navigationBarLeadingand.navigationBarTrailingfor toolbar item placement; they are deprecated. The correct, modern placements are.topBarLeadingand.topBarTrailing. - Prefer to rely on automatic grammar agreement when dealing with English, French, German, Portuguese, Spanish, and Italian. For example, use
Text("^[\(people) person](inflect: true)")to show a number of people. - You can fill and stroke a shape with two chained modifiers; you do not need an overlay for the stroke. The overlay was required previously, but this is fixed in iOS 17 and later.
- When referencing images from an asset catalog, prefer the generated symbol asset API when the project is configured to use them:
Image(.avatar)rather thanImage("avatar"). - When targeting iOS 26 and later, SwiftUI has a native
WebViewview type that replaces almost all uses of hand-wrappedWKWebViewinsideUIViewRepresentable. To use it, make sure to includeimport WebKit. ForEachover anenumerated()sequence should not convert to an array first. UseForEach(items.enumerated(), id: \.element.id)directly.- When hiding scroll indicators, use
.scrollIndicators(.hidden)rather thanshowsIndicators: falsein the initializer. - Never use
Textconcatenation 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)")
Using ObservableObject
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.
Other plugins with /api
Stats
Parent Repo Stars474
Parent Repo Forks37
Last CommitMar 9, 2026