A tactile, momentum-based radial control for SwiftUI β inspired by analog flywheels.
A SwiftUI-based, physics-inspired radial scroller for zoom, scrub, and value adjustments.
FlywheelControl mimics the feel of a real-world dial β complete with momentum, resistance, haptic feedback, and pen-friendly input.
We needed a more natural way to zoom β something better than pinch and expand.
So we built a rotary-style control that works with a finger or stylus, and feels real thanks to physics and CoreHaptics.
- ποΈ Inertial spinning like a physical dial
- π± One-finger- and Apple Pencil-friendly
- π₯ Haptic ticks for tactile feedback
- π¨ Fully SwiftUI and easy to customize
- π§ Decoupled: just emits
delta
values β you decide what to do with them
In Xcode:
- Go to
File β Add Packagesβ¦
- Enter the URL:
https://github.com/aweiner42/FlywheelControl
- Choose the latest version (e.g.,
1.0.0
)
Or add it to your Package.swift
:
.package(url: "https://github.com/aweiner42/FlywheelControl.git", from: "1.0.0")
Then add the dependency to your target:
.target(
name: "YourApp",
dependencies: ["FlywheelControl"]
)
Import the module where needed:
import FlywheelControl
let zoomManager = ZoomValueManager(
getZoom: { camera.position.z },
setZoom: { newZ in camera.position.z = newZ },
min: -50,
max: 50
)
FlywheelControl { delta in
zoomManager.adjustZoom(by: delta)
}
- iOS 17.0+
- macOS 12.0+
- Swift 5.9+
- SwiftUI + Combine
FlywheelControl includes:
- π SwiftUI Previews
- π§± Modular design (no app dependencies)
Clone this repo and open FlywheelDemoApp/FlywheelDemoApp.xcodeproj
to see the control in action.
Alan Weiner β’ SIME Corp
Inventor. Designer. Engineer. Collaborating with AI to shape intuitive interfaces.