Native ios
Skill muxammadmamajonov/dot-claude/.claude/skills/native-ios
Use for native iOS apps — Swift, SwiftUI/UIKit, Swift concurrency, Core Data/SwiftData, App Store submission, security hardening. Triggers — Swift sources, Xcode settings, Info.plist, entitlements.From its SKILL.md
npx -y skills add muxammadmamajonov/dot-claude --skill native-iosAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
7.0 KB, ~1.6k tokens by cl100k_base, as published. Nobody here has run it
Native iOS (Swift / SwiftUI) Skill
When to use
- Creating or modifying SwiftUI views, view models, or UIKit view controllers
- Designing data flow with
@State,@StateObject,@EnvironmentObject, or the Observation framework - Integrating system frameworks (Core Location, HealthKit, StoreKit 2, ARKit, etc.)
- Configuring Xcode project settings, signing, capabilities, or schemes
- Diagnosing hangs, memory leaks, or excessive CPU in Instruments
- Preparing an app for App Store review and submission
Workflow
- Confirm minimum deployment target and Swift version — check
IPHONEOS_DEPLOYMENT_TARGETandSWIFT_VERSIONin the.xcconfigor project settings. New APIs must be guarded with@available(iOS X, *). - Architecture decision (align with team before coding):
- SwiftUI + Observable / MVVM:
@Observableview models (iOS 17+) orObservableObject+@StateObject(iOS 14+); one@Observableclass per screen - TCA (The Composable Architecture): use for complex multi-screen state with explicit side-effect control
- UIKit + Coordinators: only for brownfield additions or when SwiftUI's capabilities are insufficient for the target OS
- SwiftUI + Observable / MVVM:
- SwiftUI view structure:
- Keep
Viewbodies thin — extract sub-views into separateViewstructs when a body exceeds ~30 lines - Pass only the data a subview needs; avoid threading
@EnvironmentObjectthrough more than two levels - Use
@ViewBuilderfor conditional branching inside reusable components
- Keep
- Swift concurrency:
- Mark all UI updates on
@MainActor; annotate view models with@MainActorat the class level - Use
async/awaitfor network and disk I/O; useTask { }to bridge to the async world from synchronous contexts - Cancel tasks in
onDisappearordeinitviatask.cancel()or SwiftUI's.taskmodifier (auto-cancelled on disappear)
- Mark all UI updates on
- Data persistence:
- Simple key-value:
UserDefaults(non-sensitive) orKeychain(sensitive tokens/passwords viaSecurityframework orKeychainAccesspackage) - Relational:
SwiftData(iOS 17+) orCore DatawithNSPersistentCloudKitContainerfor CloudKit sync - Network cache:
URLCachewith appropriate cache policies;NSCachefor in-memory object caching
- Simple key-value:
- Networking:
- Use
URLSessionwithasync/await; wrap in a typedAPIClientstruct - Validate SSL pinning for high-security apps via
URLSessionDelegate - Never store raw API responses; decode into typed
Codablemodels immediately
- Use
- Instruments pass before release:
- Leaks instrument: look for retain cycles (common with closures capturing
selfstrongly) - Time Profiler: identify hangs >250 ms on the main thread
- Memory Graph Debugger in Xcode: catch strong reference cycles in SwiftUI view model graphs
- Leaks instrument: look for retain cycles (common with closures capturing
- App Store preparation:
- Privacy manifest (
PrivacyInfo.xcprivacy) required for all apps; list all API categories used - App Tracking Transparency: request with
ATTrackingManager.requestTrackingAuthorizationbefore any ad SDK init - Review
Info.plistusage description strings for every permission; Apple rejects vague strings - Archive with
Product → Archive; validate and distribute via Xcode Organizer oraltool/notarytool
- Privacy manifest (
Standards
| Area | Do | Do not |
|---|---|---|
| Concurrency | async/await + structured concurrency (TaskGroup) | DispatchQueue.global().async in new Swift code |
| Memory | Use [weak self] in closures that outlive the calling scope | Capture self strongly in stored closures or NotificationCenter observers |
| SwiftUI state | @State for local view state; @StateObject / @Observable for view models | @ObservedObject for an object the view itself owns (causes re-creation bugs) |
| Keychain | Store tokens/passwords in Keychain with kSecAttrAccessibleWhenUnlockedThisDeviceOnly | Store secrets in UserDefaults or plist files |
| Permissions | Request at the moment of use with a pre-alert explaining the benefit | Request all permissions in applicationDidFinishLaunching |
| Error handling | Throw typed errors (enum AppError: Error); surface to user via .alert(error:) | try! or swallowing errors silently |
| Localization | All user-facing strings via String(localized:) or LocalizedStringKey | Hardcoded English strings in SwiftUI Text views |
Common mistakes to avoid
- Retain cycles in
@escapingclosures — closures stored as properties (timer callbacks, notification observers, Combine sinks) commonly captureselfstrongly. Use[weak self]and guard-unwrap. - Modifying
@Stateor publishing from a background thread — SwiftUI state must be mutated on the main actor. Useawait MainActor.run { }or@MainActorannotation. @StateObjectvs@ObservedObjectconfusion —@StateObjectcreates and owns the object (use in the view that initialises it);@ObservedObjectobserves an externally-provided object.- Missing
@availableguards — using iOS 17 APIs without@available(iOS 17, *)causes crashes on older devices at runtime, not compile time, unlessIPHONEOS_DEPLOYMENT_TARGETis set correctly. - Storing large data in
UserDefaults—UserDefaultsis loaded entirely into memory on app launch; store only lightweight preferences, never images or binary blobs. - Not unregistering
NotificationCenterobservers (pre-iOS 11 pattern) — in modern Swift,addObserver(forName:)returns a token that must be retained and passed toremoveObserveror the block fires after dealloc. - Skipping the privacy manifest — App Store Connect rejects submissions that use required reason APIs (file timestamps, user defaults, etc.) without a corresponding entry in
PrivacyInfo.xcprivacy.
Output format
Typical feature deliverable structure:
Sources/
Features/
<Feature>/
<Feature>View.swift # SwiftUI view; thin, delegates to VM
<Feature>ViewModel.swift # @Observable or ObservableObject; @MainActor
<Feature>Model.swift # Codable data model
Core/
Networking/
APIClient.swift # URLSession wrapper; typed request/response
Persistence/
PersistenceController.swift # SwiftData/Core Data stack
Keychain/
KeychainService.swift # Typed Keychain read/write
Tests/
<Feature>ViewModelTests.swift
<Feature>APIClientTests.swift
Related checklists
.claude/checklists/security.md.claude/checklists/performance.md.claude/checklists/accessibility.md.claude/checklists/production.md
Related agents
.claude/agents/engineering/mobile-engineer.md.claude/agents/design/mobile-ux-specialist.md.claude/agents/quality/performance-engineer.md.claude/agents/quality/security-auditor.md.claude/agents/quality/accessibility-auditor.md
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.