Swift Core Motion guide for sensors, pedometer, activity recognition, and altitude on iOS 26.

CCM score
69 of 100
skills.sh installs
4K
GitHub stars
1.3K
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers accelerometer, gyroscope, device-motion, pedometer, activity recognition, and altimeter APIs with runnable Swift snippets
  • Includes NSMotionUsageDescription setup, per-manager authorization checks, and attitude reference frame fallbacks for device motion
  • Enforces one shared CMMotionManager per app, since multiple instances degrade sensor update rates
  • Designed for iOS developers reading device sensors, counting steps, or detecting walking, running, driving, and cycling

Install

$ npx -y skills add dpearson2699/swift-ios-skills --skill core-motion -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

CoreMotion

Read device motion, pedometer/activity, altitude, headphone, batched-workout, and submersion sensors with Core Motion. Scope: Swift 6.3, iOS 26+.

Contents

Setup

Info.plist

Add NSMotionUsageDescription to Info.plist with a user-facing string explaining why your app needs motion data. Without this key, the app crashes on first access.

<key>NSMotionUsageDescription</key>
<string>This app uses motion data to track your activity.</string>

Authorization

Details

Repository
github.com/dpearson2699/swift-ios-skills
Category
Mobile Apps
First seen
Apr 16, 2026

More from dpearson2699/swift-ios-skills

All 94

Similar to Core Motion

More Mobile Apps