iOS (Swift and SwiftUI) checklist¶
Copy this list into a pull request, design review or project kickoff and tick what applies. Rules are grouped by level and sorted by score (criteria). Each links to the file that explains it and cites its sources. Automatable names tools that can check the rule in CI (see the file's "How to enforce" section).
Also apply the general checklist.
This file is generated by python3 scripts/rank.py fix from the guidelines. Don't edit it by hand.
Strongly recommended (9–10)¶
-
IOS-6(9) Store tokens, passwords and keys in the Keychain with the most restrictive accessibility that works for the app, such askSecAttrAccessibleWhenUnlockedThisDeviceOnly, not inUserDefaults, which stores data on disk unencrypted. (specific/ios) -
IOS-7(9) Sign users in throughASWebAuthenticationSession, with the authorization code flow and PKCE (AUTH-2), never in aWKWebView. (specific/ios) -
IOS-9(9) Add a privacy manifest (PrivacyInfo.xcprivacy) to the app that declares the data it collects and an approved reason for each required reason API it uses, use the SDKs on Apple's list only in versions that include their privacy manifest (and their signature, if you add them as binaries), and compare the privacy report that Xcode generates from all the manifests with the App Store privacy details before each release. (specific/ios) Automatable: App Store Connect upload checks, Verifying the origin of your XCFrameworks.
Recommended (6–8)¶
-
IOS-8(8) Keep App Transport Security on: don't setNSAllowsArbitraryLoads, fix a server that fails the ATS checks instead of adding an exception, and limit any exception you can't avoid to the domains that need it. (specific/ios) -
IOS-1(7) Make each shared model an@Observableclass, create it with@State private varin the view orAppthat owns it, and pass it down as a plain property, with@Bindablewhere a subview needs bindings, or through.environment(_:). (specific/ios) -
IOS-2(7) Keep data and the logic that changes it in model types, not in views, and use@Stateonly for state that a view owns: declare itprivatein the highest view that needs it, and pass the value or a binding to subviews. (specific/ios) Automatable: SwiftLint. -
IOS-3(7) Build every target in the Swift 6 language mode, which prevents data races at compile time. Migrate older modules one at a time, for example by setting Strict Concurrency Checking to Complete in the Swift 5 mode first and fixing the warnings. (specific/ios) Automatable: Swift 6 language mode, Thread Sanitizer and Main Thread Checker. -
IOS-4(7) Keep UI code and UI state on the main actor, and add concurrency only where you need it: set Default Actor Isolation toMainActorfor app targets, run heavy work off the main actor with@concurrentfunctions, and keep other mutable state that tasks share in actors. (specific/ios) Automatable: Thread Sanitizer and Main Thread Checker. -
IOS-10(7) Save the user's work when the scene phase changes to.background, because the app may be terminated soon after, and restore lightweight UI state, such as the selected tab, with@SceneStorage. Keep model data and sensitive data out of@SceneStorage. (specific/ios) -
IOS-12(7) Persist structured app data with SwiftData, or Core Data, and version the schema from the first release: describe each released schema with aVersionedSchema, and the migrations between them with aSchemaMigrationPlan. (specific/ios) -
IOS-14(7) Use the built-in text styles, and make any custom font scale the same way, so that text follows Dynamic Type, give every meaningful image and custom control a VoiceOver label, and hide decorative images from VoiceOver. (specific/ios) Automatable: Accessibility audits in UI tests, SwiftLint. -
IOS-15(7) Write unit tests with Swift Testing and UI tests with XCTest and XCUIAutomation, in a test pyramid (TEST-1), and run them on every pull request withxcodebuild testor Xcode Cloud. (specific/ios) -
IOS-16(7) Sign release builds with cloud-managed certificates, through automatic signing in Xcode or in Xcode Cloud, and never commit exported signing identities or their passwords. (specific/ios) -
IOS-5(6) Useasync let, task groups and SwiftUI's.taskmodifier rather than unstructuredTask { }, and when you do create aTask, keep its handle and cancel it when its work is no longer needed. (specific/ios) -
IOS-11(6) Do background work only through the system's mechanisms: finish a task the user started withbeginBackgroundTask(withName:expirationHandler:), transfer large files with a backgroundURLSession, and schedule refreshes and maintenance asBGAppRefreshTaskandBGProcessingTaskrequests. (specific/ios) -
IOS-13(6) Make HTTP requests withURLSessionand its async methods, setwaitsForConnectivityso that a request waits for a network instead of failing at once, and keep the data the user needs offline in local storage. (specific/ios)