mobile-ios-swift
Implements guild-plan.md §6.1 (mobile · ios-swift) under §6.4 engineering principles: idiomatic Swift, compiler-enforced safety, and concurrency that the language actually tracks.
What you do
Write Swift that the compiler helps keep correct. Pick SwiftUI when the minimum deployment target allows and the screen is data-driven; fall back to UIKit when custom transitions, legacy integration, or fine control demand it. Use Swift Concurrency (async/await, actors) rather than GCD unless interop requires it.
- Prefer
let, value types, and protocol-oriented composition over inheritance.
- Use optional binding (
if let, guard let) and typed throws — ! is a smell.
- Mark UI work
@MainActor; keep I/O off the main thread with Task.detached or async functions.
- Manage references:
[weak self] in closures that outlive the owner, break retain cycles explicitly.
- Use structured concurrency (
TaskGroup, async let) for parallel work; cancel cooperatively.
- Accessibility first:
accessibilityLabel, Dynamic Type, VoiceOver checked.
Output shape
Swift source files plus a short build note:
- Source — one file per logical unit; follow Apple's API Design Guidelines.
- Previews —
#Preview for SwiftUI, snapshot tests for UIKit.
- Build notes — SPM dependency additions, minimum iOS target, Xcode scheme impact.
- Tests — XCTest file exercising the non-UI logic.
- Accessibility — a short checklist pass (labels, traits, Dynamic Type).
Anti-patterns
- Force-unwraps (
!) and forced casts (as!) in production paths.
- Retain cycles in
self-capturing closures (timers, Combine sinks, callbacks).
- Main-thread blocking:
DispatchQueue.main.sync, disk / network on UI calls.
@ObservedObject on a model the view owns — use @StateObject.
- Massive view controllers / massive views — extract models and view models.
- Swallowed errors with
try? where a real error path exists.
Handoff
Return the Swift source paths and build notes to the invoking mobile specialist. If the feature needs Android parity, the mobile agent chains into mobile-android-kotlin; for cross-platform, mobile-react-native. Performance tuning lives in mobile-performance-tuning. This skill does not dispatch.
Source: lookatitude/guild — distributed by TomeVault.
1---2name: lookatitude-guild-mobile-ios-swift3description: mobile-ios-swift4---56# mobile-ios-swift78Implements `guild-plan.md §6.1` (mobile · ios-swift) under `§6.4` engineering principles: idiomatic Swift, compiler-enforced safety, and concurrency that the language actually tracks.910## What you do1112Write Swift that the compiler helps keep correct. Pick SwiftUI when the minimum deployment target allows and the screen is data-driven; fall back to UIKit when custom transitions, legacy integration, or fine control demand it. Use Swift Concurrency (`async/await`, actors) rather than GCD unless interop requires it.1314- Prefer `let`, value types, and protocol-oriented composition over inheritance.15- Use optional binding (`if let`, `guard let`) and typed throws — `!` is a smell.16- Mark UI work `@MainActor`; keep I/O off the main thread with `Task.detached` or `async` functions.17- Manage references: `[weak self]` in closures that outlive the owner, break retain cycles explicitly.18- Use structured concurrency (`TaskGroup`, `async let`) for parallel work; cancel cooperatively.19- Accessibility first: `accessibilityLabel`, Dynamic Type, VoiceOver checked.2021## Output shape2223Swift source files plus a short build note:24251. **Source** — one file per logical unit; follow Apple's API Design Guidelines.262. **Previews** — `#Preview` for SwiftUI, snapshot tests for UIKit.273. **Build notes** — SPM dependency additions, minimum iOS target, Xcode scheme impact.284. **Tests** — XCTest file exercising the non-UI logic.295. **Accessibility** — a short checklist pass (labels, traits, Dynamic Type).3031## Anti-patterns3233- Force-unwraps (`!`) and forced casts (`as!`) in production paths.34- Retain cycles in `self`-capturing closures (timers, Combine sinks, callbacks).35- Main-thread blocking: `DispatchQueue.main.sync`, disk / network on UI calls.36- `@ObservedObject` on a model the view owns — use `@StateObject`.37- Massive view controllers / massive views — extract models and view models.38- Swallowed errors with `try?` where a real error path exists.3940## Handoff4142Return the Swift source paths and build notes to the invoking `mobile` specialist. If the feature needs Android parity, the mobile agent chains into `mobile-android-kotlin`; for cross-platform, `mobile-react-native`. Performance tuning lives in `mobile-performance-tuning`. This skill does not dispatch.4344---45> Source: [lookatitude/guild](https://github.com/lookatitude/guild) — distributed by [TomeVault](https://tomevault.io).46<!-- tomevault:4.0:skill_md:2026-05-22 -->