β All skills
Swift Developer
Use when building iOS 17+ applications with SwiftUI, Combine, structured concurrency, and Apple platform APIs.
About this skill
Use when building iOS 17+ applications with SwiftUI, Combine, structured concurrency, and Apple platform APIs.
SKILL.md
swift-developer.SKILL.mdPlace it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review the contents and run it in a controlled environment first.
--- name: Swift Developer description: Use when building iOS 17+ applications with SwiftUI, Combine, structured concurrency, and Apple platform APIs. category: Languages version: 1.0.0 tools: [] --- # SwiftUI & Structured Concurrency Development Build polished, performant applications for Apple platforms using SwiftUI, async/await, and native APIs. ## SwiftUI Architecture - Use MVVM pattern: Views observe ViewModels via `@Observable` (iOS 17+) or `@ObservedObject` - Keep views declarative and free of business logic; views describe what to render, ViewModels determine data - Use `@State` for view-local state, `@Binding` for parent-child communication, `@Environment` for dependency injection - Extract reusable view components into separate files when exceeding 50 lines or reused in multiple places - Use `NavigationStack` with `NavigationPath` for programmatic routing; avoid deprecated `NavigationView` ## Structured Concurrency - Use `async/await` for all asynchronous operations; replace completion handlers and Combine publishers - Use `Task` for launching concurrent work from synchronous contexts; `TaskGroup` for structured fan-out - Mark view model methods as `@MainActor` when updating published properties that drive UI - Use `actor` for shared mutable state requiring serialized access; prefer actors over manual locks - Handle cancellation explicitly; check `Task.isCancelled` in loops and throw `CancellationError` when appropriate ## Data Flow & Persistence - Use SwiftData for local persistence on iOS 17+; define models with `@Model` macro; query with `@Query` - Use `ModelContainer` at app level and pass `ModelContext` through environment - Implement optimistic UI updates: update local model immediately, sync server in background, reconcile on failure - Use `Codable` for all API response types; implement custom `CodingKeys` when API field names differ - Cache network responses with `URLCache` for simple cases; use SwiftData for complex offline-first scenarios ## Platform Integration - Use `PhotosPicker` for image selection, `ShareLink` for sharing, `DocumentGroup` for document-based apps - Implement widgets with `WidgetKit`; keep timelines short (5-10 entries); use `IntentConfiguration` for customizable widgets - Use `UserNotifications` for local notifications; request permission at contextually relevant moments - Support Dynamic Island with `ActivityKit` for live activities surfacing real-time information - Implement App Intents for Siri and Shortcuts integration; define `AppIntent` structs with typed parameters ## Performance & Optimization - Profile with Instruments: Time Profiler for CPU, Allocations for memory, Core Animation for rendering - Use `Equatable` conformance on view models and `EquatableView` to skip redundant renders - Lazy-load large collections with `LazyVStack` and `LazyHStack`; avoid `List` with 1000+ items without pagination - Use `nonisolated` on actor properties not requiring synchronization to avoid unnecessary actor hops - Minimize `@Published` property count; combine related state into structs to reduce observation overhead ## Testing - Write unit tests for ViewModels using XCTest; mock network layers with protocol-based DI - Use `ViewInspector` or snapshot testing for SwiftUI view verification - Test async code with `async` test methods; use `XCTestExpectation` only for callback-based legacy code - Run UI tests with XCUITest for critical flows: onboarding, purchase, authentication ## Before Completing - Build for all target platforms (iPhone, iPad, Mac Catalyst); verify layout adapts correctly - Run `swift build` with `-strict-concurrency=complete` for strict concurrency checking - Profile with Instruments to verify no memory leaks or excessive CPU usage - Test with VoiceOver enabled to verify accessibility labels and navigation
Install
Syntic App
- 1Create a dedicated folder for this skill in your local skills library.
- 2Place SKILL.md into that folder.
- 3Restart Syntic and invoke this skill on matching tasks.
Syntic Code (CLI)
- 1Save SKILL.md in your local Syntic Code skills directory.
- 2Keep related files in the same skill folder.
- 3Run in a safe environment and validate outputs.