Skip to content

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.

  • IOS-6 (9) Store tokens, passwords and keys in the Keychain with the most restrictive accessibility that works for the app, such as kSecAttrAccessibleWhenUnlockedThisDeviceOnly, not in UserDefaults, which stores data on disk unencrypted. (specific/ios)
  • IOS-7 (9) Sign users in through ASWebAuthenticationSession, with the authorization code flow and PKCE (AUTH-2), never in a WKWebView. (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.
  • IOS-8 (8) Keep App Transport Security on: don't set NSAllowsArbitraryLoads, 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 @Observable class, create it with @State private var in the view or App that owns it, and pass it down as a plain property, with @Bindable where 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 @State only for state that a view owns: declare it private in 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 to MainActor for app targets, run heavy work off the main actor with @concurrent functions, 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 a VersionedSchema, and the migrations between them with a SchemaMigrationPlan. (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 with xcodebuild test or 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) Use async let, task groups and SwiftUI's .task modifier rather than unstructured Task { }, and when you do create a Task, 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 with beginBackgroundTask(withName:expirationHandler:), transfer large files with a background URLSession, and schedule refreshes and maintenance as BGAppRefreshTask and BGProcessingTask requests. (specific/ios)
  • IOS-13 (6) Make HTTP requests with URLSession and its async methods, set waitsForConnectivity so 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)