FlywheelControl

main

πŸŒ€ FlywheelControl A tactile, physics-based radial scrolling control for SwiftUI β€” inspired by analog flywheels and designed for intuitive zooming or value adjustment. Built with haptics, momentum, and accessibility in mind.
aweiner42/FlywheelControl

FlywheelControl

SwiftPM Compatible Platforms

A tactile, momentum-based radial control for SwiftUI β€” inspired by analog flywheels.
FlywheelControl Logo

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.


πŸŒ€ Why FlywheelControl?

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.


✨ Features

  • πŸŽ›οΈ 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

πŸ“¦ Installation

Swift Package Manager

In Xcode:

  1. Go to File β†’ Add Packages…
  2. Enter the URL: https://github.com/aweiner42/FlywheelControl
  3. 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

🎯 Example Integration

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)
}

πŸ”§ Requirements

  • iOS 17.0+
  • macOS 12.0+
  • Swift 5.9+
  • SwiftUI + Combine

πŸ§ͺ Previews & Tests

FlywheelControl includes:

  • πŸ” SwiftUI Previews
  • 🧱 Modular design (no app dependencies)

πŸ”„ Try It Live

Clone this repo and open FlywheelDemoApp/FlywheelDemoApp.xcodeproj to see the control in action.


✍️ Created by

Alan Weiner β€’ SIME Corp
Inventor. Designer. Engineer. Collaborating with AI to shape intuitive interfaces.

Description

  • Swift Tools 6.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon May 26 2025 01:21:36 GMT-0900 (Hawaii-Aleutian Daylight Time)