Swift App Features and Concurrency Fixes
Build SwiftUI features, fix async and actor bugs, and refactor Swift code with explicit state ownership and focused tests.
Before & after
Same prompt, same agent — the only difference is the skill.
I can help you build that SwiftUI screen. You'd want to set up a State variable to hold the product data, then use some layout containers to arrange the information on the screen. SwiftUI has built-in components like VStack and HStack that make it pretty straightforward. You might also want to think about how the data flows from your model to the view. There are a few different approaches to state management in SwiftUI depending on your needs. Would you like me to walk through a basic example first?
SWIFTUI DETAIL SCREEN
ARCHITECTURE: Protocol-Oriented with ObservedObject
protocol ProductDisplay {
var id: String { get }
var title: String { get }
var price: Decimal { get }
var images: [URL] { get }
}
class ProductViewModel: ObservableObject {
@Published var product: ProductDisplay?
@Published var isLoading = false
@Published var error: Error?
func load(productId: String) async {
isLoading = true
do {
product = try await fetchProduct(productId)
} catch {
self.error = error
}
isLoading = false
}
}
struct ProductDetailView: View {
@StateObject var viewModel = ProductViewModel()
var body: some View {
if let product = viewModel.product {
VStack(spacing: 16) {
AsyncImage(url: product.images.first)
Text(product.title).font(.headline)
Text("$" + String(product.price)).font(.title2)
}
} else if viewModel.isLoading {
ProgressView()
} else if let error = viewModel.error {
ErrorView(error: error)
}
}
}
STATE MANAGEMENT
Data binding: ViewState drives UI refresh
Async/await: Load product on appear
Error handling: Shows error overlay
Actor isolation: Thread-safe data fetchingAbout this skill
“My SwiftUI screen keeps resetting” and “adding an actor didn't fix the race” usually point to ownership or lifecycle problems. This skill builds and repairs Swift features by tracing who owns state, where asynchronous work runs, and which results are still allowed to update the screen.
What it does
- Selects SwiftUI property wrappers from ownership, observation, and deployment requirements.
- Repairs cancellation, stale search results, actor reentrancy, and strict concurrency diagnostics.
- Separates UI isolation from networking, expensive computation, and shared mutable storage.
- Designs focused protocol boundaries without turning every type into an abstraction.
- Handles UIKit coordinators, callback continuations, Combine bridges, and Vapor request boundaries.
- Produces targeted verification cases for lifecycle, overlapping requests, failures, and cancellation.
What you get
A scoped implementation, patch, or code review with explicit assumptions, ownership decisions, and verification status. Larger features include the integration points and focused tests needed to assess the behavior.
Best for
Developers building or maintaining Swift applications across Apple platforms, teams migrating concurrency code, and engineers debugging SwiftUI state or shared asynchronous services.
SKILL.md preview
---
name: swift-app-features-and-concurrency-fixes
description: >-
Builds and repairs Swift features by tracing SwiftUI state ownership, actor isolation, task lifetime, and protocol boundaries, then producing scoped code and focused verification cases. Use when the user says "build this SwiftUI screen", "my view keeps resetting", "fix this Sendable error", "my search shows old results", "convert this callback to async await", "review this actor for races", "wrap this UIKit control", or "refactor this Vapor handler".
---
# Swift App Features and Concurrency Fixes
… (sign up to view the full skill)More development skills
View all Development skills →SQL Query Optimization and Schema Review
Get SQL rewrites, evidence-based index recommendations, schema reviews, and dialect migrations with validation steps.
C# API and Blazor Implementation
Build and fix C# APIs and Blazor components with safe EF Core queries, cancellation, and focused tests.
Rust Code Implementation and Debugging
Get Rust code and targeted fixes for ownership, lifetimes, traits, Tokio concurrency, errors, and unsafe boundaries.
Type-Safe PHP Applications and APIs
Build and repair typed PHP applications with Laravel or Symfony, safe database changes, and targeted tests.