---
description: Native iOS conventions — verification is CI-only (no Mac locally)
globs: ios/**, **/*.swift, **/*.m, **/*.mm, **/*.h, **/Podfile, **/Podfile.lock, **/Info.plist
alwaysApply: false
---

# Native iOS

The developer does NOT have a Mac. iOS code is written here and
verified on CI. Do not suggest local Xcode, `pod install`, or
`xcodebuild` commands.

> Adjust `ios/` to your repo's actual path (e.g.
> `apps/mobile/ios/`).

Stack: Swift first, Obj-C only for RN bridge boilerplate.
Build: Xcode + CocoaPods on the CI runner.
Deployment target: read `ios/Podfile` `platform :ios, 'X.Y'` —
do NOT raise it without checking RN library compatibility.

## Conventions

- Native modules for RN: `*.swift` for logic + `*.m` bridge with
  `RCT_EXTERN_METHOD` declarations.
- Async: Swift Concurrency (`async`/`await`, `Task`). Combine only
  where the API requires it.
- No callback pyramids. No `DispatchQueue.main.async` wrapping
  unless updating UIKit on a background queue.
- Logging: `os_log` or `Logger` with subsystem matching the bundle
  ID.
- UI: SwiftUI for new screens; programmatic UIKit if existing
  patterns require it.
- Strings: `Localizable.strings`. No hardcoded user-facing text.
- Permissions: usage descriptions in `Info.plist`
  (NSCameraUsageDescription, NSMicrophoneUsageDescription, etc.)
  AND runtime requests.

## Verification (CI only)

After editing iOS files, do NOT ask the developer to run anything
locally for iOS. Instead:

1. Make the edit.
2. Suggest `/rn-verify` to catch JS/Android-side issues.
3. When ready, suggest `/rn-ship-ios` to push and trigger CI.
4. If CI fails, use `/ios-ci-logs` to diagnose.

Special case: if the change is purely in `Info.plist` strings
(e.g., adding a permission description), it's worth flagging that
the change is low-risk but must still go through CI.

## What NOT to do

- Do not edit `*.pbxproj` by hand. The developer can't open Xcode
  to fix a corrupted project file.
- Do not bump `Podfile.lock` unless that's the explicit task —
  `pod install` runs on CI.
- Do not change `IPHONEOS_DEPLOYMENT_TARGET` without checking
  which RN libs it breaks.
- Do not commit `.xcuserstate`, `xcuserdata/`, or `ios/build/`.
- Do not suggest the developer "test on simulator" or "run from
  Xcode" — they cannot.
- Do not claim iOS changes are verified just because TS passed —
  the developer must trigger CI.
