core-motion

Access accelerometer, gyroscope, magnetometer, pedometer, and activity data on iOS and watchOS.

981|50|Updated Mar 3, 2026
One-click install
npx skills add https://github.com/dpearson2699/swift-ios-skills --skill core-motion-dpearson2699
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: core-motion
Source: https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/core-motion
Command: npx skills add https://github.com/dpearson2699/swift-ios-skills --skill core-motion-dpearson2699

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides access to device motion and sensor data, enabling applications to understand and react to the physical world around the user.

Core Features & Use Cases

  • Sensor Data Access: Utilize accelerometer, gyroscope, and magnetometer for motion tracking.
  • Activity Recognition: Detect user activities like walking, running, or driving.
  • Pedometer Data: Track steps, distance, and floors climbed for fitness applications.
  • Altitude Tracking: Obtain relative and absolute altitude data.
  • Use Case: Develop a fitness app that tracks daily steps and distance, or a game that uses device tilt for control.

Quick Start

Start receiving accelerometer updates at 60 Hz and print the x, y, and z values to the console.

Frequently Asked Questions about core-motion

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I access accelerometer and gyroscope data on iOS?

You can access accelerometer and gyroscope data on iOS using the CoreMotion framework, which enables reading device sensor values like acceleration and rotation. Start receiving accelerometer updates at a specified frequency, such as 60 Hz, and process the x, y, and z values.

How do I track steps and distance for a fitness app on watchOS?

Track steps and distance on watchOS using CoreMotion pedometer data capabilities. The framework enables counting steps, calculating distance traveled, and tracking floors climbed, providing the necessary sensor inputs for fitness application development.

Can I detect user activity like walking or driving using device motion?

Yes, you can detect user activity like walking, running, or driving using CoreMotion activity recognition features. The framework analyzes device motion patterns to identify and classify the user's current physical activity type.

Do I need specific Info.plist keys to use CoreMotion sensors?

Yes, you need appropriate Info.plist keys for usage descriptions when using CoreMotion sensors. The framework requires these privacy usage descriptions to access device motion data, including accelerometer, gyroscope, and magnetometer readings on iOS and watchOS.

What is the best way to track altitude changes on iOS?

The best way to track altitude changes on iOS is using CoreMotion altitude tracking capabilities. The framework provides access to both relative and absolute altitude data, enabling applications to monitor elevation changes during user movement.

Can I use device tilt for game controls with CoreMotion?

Yes, you can use device tilt for game controls by implementing motion-based interactions with CoreMotion. The framework provides accelerometer and gyroscope data that enables detecting device orientation and tilt for controlling game elements.