- Home
- Skills
- Frontend & Web Apps
- SwiftUI View Auditor: State, Async, Perf & Accessibility
Works with the AI Agents you already use
SwiftUI View Auditor: State, Async, Perf & Accessibility
Reviews SwiftUI views for real bugs: state ownership, racing tasks, work in body, list identity, localization and VoiceOver gaps.
$5
SwiftUI View Auditor: State, Async, Perf & Accessibility
Example session with this skill installed
[REAL public repo, run for this test: github.com/Ranchero-Software/NetNewsWire at commit bb5ab3dc]
User: "Audit iOS/Add/AddFeedView.swift before release."
Files read: AddFeedView.swift (130 lines), View+Extras.swift (errorAlert), RSCore String+RSCore.swift (mayBeURL, normalizedURL), Account.createFeed(url:name:container:validateFeed:completion:).
- Read your context and instructions
- Compiled the swiftui view auditor
SwiftUI review - iOS/Add/AddFeedView.swift (NetNewsWire, bb5ab3dc)
Summary: Solid. Dismissal is blocked while adding, errors surface through a shared alert, and the completion handler runs on the main actor. The one thing worth changing before release is reading the pasteboard in init, which can show iOS's paste banner more than once. The rest is polish.
Findings
1. Pasteboard read in init - Medium / lines 24-28
What happens: reading UIPasteboard.general.string makes iOS show the "NetNewsWire pasted from ..." banner, or a paste-permission prompt depending on settings. SwiftUI may call a view's init more than once while the sheet is on screen, for example when the parent re-renders. Each call reads the pasteboard again, even though State(initialValue:) only uses the first value. So the banner can likely appear more than once, or when the user didn't expect a read.
Why: side effects in a View initializer aren't tied to the view's lifetime.
Fix: read once when the sheet appears. Better still, check for a URL first without reading the content:
.task {
guard urlString.isEmpty, UIPasteboard.general.hasURLs || UIPasteboard.general.hasStrings,
let s = UIPasteboard.general.string, s.mayBeURL else { return }
urlString = s.normalizedURL
}
That keeps the banner to one appearance per sheet. Merge it with the existing focus logic in onAppear (finding 3). A PasteButton in the URL section is the no-banner alternative.
2. Whitespace-only title becomes the feed's name - Low / line 114
What happens: a title of " " is passed as the feed name, so the feed shows up blank in the sidebar.
Why: name.isEmpty ? nil : name doesn't trim. Folder names got trimming in commit 91f0409d. Feed titles didn't.
Fix:
let trimmedName = name.trimmingCharacters(in: .whitespacesAndNewlines)
let feedName = trimmedName.isEmpty ? nil : trimmedName
3. Keyboard re-focus when coming back from the folder picker - Low / lines 80-84 (verify)
What happens: onAppear on the Form likely fires again when the user pops back from AddFeedContainerPickerView. If the URL is still empty, the keyboard jumps up again. Some people will like that; it can also cover the Folder row they just set.
Fix: guard with a @State private var didAutoFocus = false, or move the focus into the one-time .task from finding 1.
4. The progress indicator has no accessibility label - Low / lines 68-70
VoiceOver will announce a generic progress element in the confirmation slot. Use ProgressView().accessibilityLabel(NSLocalizedString("Adding feed", comment: "...")) so it's clear what's happening and where the Add button went.
Looked fine
createFeed's completion runs insideTask { @MainActor in ... }(Account.swift), so settingisAddinganderrorMessagethere is safe..interactiveDismissDisabled(isAdding)and the disabled Cancel button prevent half-finished adds.canAddusesmayBeURL, which trims whitespace, andaddFeed()normalizes beforeURL(string:).- Duplicate-subscription check happens before the network call.
- All user-facing strings go through
NSLocalizedStringwith comments. BatchUpdate.shared.start()and.end()are balanced on both success and failure paths.
Not checked
AddFeedContainerPickerViewandAddFeedDefaultContainer- Behaviour on iPad multitasking and with hardware keyboards
- Runtime behaviour. Findings 1 and 3 are inferred from SwiftUI's documented lifecycle, not observed.
Connects securely to your tools. The creator never sees your data.
About this skill
Finds bugs in an existing view, with line numbers — not a style guide. A focused review of one or a few SwiftUI files, the way a careful senior iOS engineer would do it. Few findings, each with line numbers, the user-visible effect, the mechanism and a minimal fix.
What it checks, in priority order:
- State ownership: @State/@StateObject/@Observable mix-ups, view models recreated on render
- Async and lifecycle: unstructured Task {} racing .task(id:), swallowed errors that leave a screen stuck loading, missing cancellation
- Work in body: linear lookups inside ForEach, formatters, sorting
- List identity: unstable ids, rows silently dropped by if-let
- Localization: literals missing from the string catalog
- Accessibility: unlabeled controls, bare numbers, placeholder content read by VoiceOver
It opens dependent types before judging and marks guesses as "verify", so no style nitpicks or invented performance numbers. Example reviews, generated by running the skill on real open-source files (Ice Cubes, NetNewsWire), are included.
Not affiliated with Apple. SwiftUI is a trademark of Apple Inc.
Cannot verify private dependencies outside provided files. Does not audit styling, naming, or architectural preference. Limited to SwiftUI logic bugs and performance.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 23 days ago