Pull to Refresh is my iPhone app that locks the apps you choose and unlocks them for exercise reps counted by the camera ( App Store ). This is the developer side: counting reps from Vision joint positions, what Apple's Screen Time API lets a third-party app do, and the bugs that taught me both. What the app does for its users is in the user-facing post .
One number per exercise, one state machine
VNDetectHumanBodyPoseRequest runs on every frame of a 1280×720 front-camera feed. I keep joints with a confidence of 0.3 or more and drop the frame; nothing is recorded.
What kept the counter small: every exercise reduces a pose to one Double , oriented so that low means contracted and high means extended. Push-ups, squats and sit-ups use a joint angle, averaged over both sides of the body when both are visible.…