skills/mobile/ios-frameworks/SKILL.md
CoreData/SwiftData, CoreML, ARKit, CloudKit, StoreKit 2, HealthKit, CoreLocation, APNs push
npx skillsauth add alphaonedev/openclaw-graph ios-frameworksInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill equips the AI to assist with iOS app development using Apple's core frameworks, focusing on data management, ML integration, AR experiences, cloud syncing, in-app purchases, health tracking, location services, and push notifications.
Use this skill for apps requiring local data persistence (e.g., user profiles), integrating ML models for predictions, building AR overlays, syncing data to iCloud, handling purchases, accessing health data, tracking user locations, or sending push notifications. Apply it in scenarios like e-commerce apps with payments, fitness trackers, or AR games.
To use CoreData, initialize a persistent container in AppDelegate and perform fetches in view controllers. For ARKit, start an AR session in a UIViewController subclass and handle anchor updates. Integrate CoreML by loading a .mlmodel file and running predictions in response to user input. Pattern for CloudKit: Use CKDatabase to save records and subscribe to changes. For StoreKit 2, request products and process transactions in a payment queue observer. Access HealthKit by querying HKSampleType after requesting authorization. Use CoreLocation by configuring CLLocationManager delegates for updates. For APNs, register for remote notifications and handle incoming payloads in AppDelegate.
let container = NSPersistentContainer(name: "MyApp")container.loadPersistentStores { ... }let model = MyModel() let input = MyModelInput(...) let output = try model.prediction(input: input)let session = ARSession() session.delegate = self session.run(ARWorldTrackingConfiguration())let record = CKRecord(recordType: "MyType") record["field"] = "value" database.save(record) { ... }let request = SKProductsRequest(productIdentifiers: ["com.example.product"]) request.start() // In delegate, handle products and SKPaymenthealthStore.requestAuthorization { ... } let query = HKSampleQuery(sampleType: HKQuantityType(...), ...) { ... }locationManager.requestWhenInUseAuthorization() locationManager.startUpdatingLocation()UNUserNotificationCenter.current().requestAuthorization { ... } application.registerForRemoteNotifications()Add frameworks via Xcode: Select target > General > Frameworks, Libraries, and Embedded Content, then add CoreData.framework, etc. For permissions, update Info.plist (e.g., NSLocationWhenInUseUsageDescription for CoreLocation). Use environment variables for keys like $CLOUDKIT_API_KEY in scripts or configs. For CloudKit, enable iCloud capability in Xcode and set up a container in the developer portal. Import modules in code (e.g., import CoreData). For APNs, generate a certificate in Apple Developer portal and use it with your server. Config format: In entitlements file, add iCloud capabilities like com.apple.developer.icloud-container-identifiers. Ensure SwiftData compatibility by targeting iOS 17+.
For CoreData, catch NSPersistentStoreCoordinator errors during setup (e.g., catch let error as NSError { print(error.localizedDescription) }). In CoreML, handle prediction errors with do { try model.prediction(...) } catch { print(error) }. ARKit sessions may throw ARSession.RunOptions errors; check session state in delegate methods. CloudKit operations use CKError; handle with if case .partialFailure(let errors) = error { ... }. StoreKit errors from SKPaymentTransaction include codes like .paymentCancelled; observe queue for failures. HealthKit authorization failures require UI prompts; check error as HKErrorCode. CoreLocation errors via delegate's didFailWithError; use error codes for debugging. For APNs, handle registration errors in AppDelegate's didFailToRegisterForRemoteNotificationsWithError.
Example: Building a CoreData-based To-Do App
Set up CoreData in a new project: Create a data model in Xcode, then in ViewController.swift, fetch items with:
let fetchRequest: NSFetchRequest<Item> = Item.fetchRequest() do { let items = try context.fetch(fetchRequest) } catch { ... }
Save a new item: let newItem = Item(context: context); newItem.name = "Task"; try context.save().
Example: Integrating ARKit for Object Detection
In a ARViewController, configure for object detection:
let configuration = ARWorldTrackingConfiguration() configuration.detectionImages = Set([ARReferenceImage(...)] ) session.run(configuration)
Handle detection in session(_:didUpdate:) delegate to overlay UI elements.
tools
Root web development: project structure, tooling selection, deployment decisions
development
WebAssembly: Rust/Go/C to WASM, wasm-bindgen, Emscripten, WASM Component Model
development
Vue 3: Composition API script setup, Pinia, Vue Router 4, SFCs, Vite, Nuxt 3
tools
Tailwind CSS 4: utility classes, config, JIT, arbitrary values, darkMode, plugins, shadcn/ui