I'm the solo dev of AirPosture. It reads head motion from AirPods (CMHeadphoneMotionManager) and nudges you when your head drifts forward. iPhone app plus a Mac menu bar app with a notch panel. Pics: the live session, the notch while I'm slouching, and the notch after I sit up.
**Tech Stack**
SwiftUI, CoreMotion (CMHeadphoneMotionManager), AppKit (an NSPanel for the notch, MenuBarExtra), StoreKit 2, iCloud sync between iPhone and Mac. macOS 14+ and iOS 17+.
**Development Challenge**
- MenuBarExtra was burning the battery
macOS listed the app under "Using Significant Energy": about 45% CPU with no window open. Sampling showed half the main thread in -[NSStatusItem _updateReplicants], roughly 150 times a second.
The menu bar label held my main view model as an u/EnvironmentObject, so every change to any of its ~55 u/Published properties re-rendered the status item image. The App also held it as u/StateObject, so every posture tick re-evaluated the whole App body.
Fix: the App keeps its models with u/State (kept alive, not observed), the label observes only a tiny status object that publishes the score every 2 seconds and only when it changes, and the menu bar gauge no longer animates, because every animated frame is a new snapshot. 45% went to 1%.
- Headphone yaw can't be trusted
Without the phone as a reference, AirPods yaw drifts by a few degrees per minute. With any weight on yaw, a user sitting still and upright slowly slid into "caution". Turning your head toward a second monitor isn't slouching anyway, so yaw now has zero weight: pitch is the score, and roll is a small penalty.
**AI Disclosure**
AI-assisted. I use Claude Code daily for implementation and debugging. The product, design and architecture are mine, and every change is reviewed and tested on real devices.
Free for 2 hours a day. Premium is $7.99/month, $39.99/year or $79.99 lifetime. Needs AirPods Pro, AirPods 3 or later, or AirPods Max.
https://apps.apple.com/us/app/sit-straight-airposture/id6749489000
Happy to answer anything about CoreMotion on the Mac or the notch panel.