π OneFingerRotationGesture v1.0.0
A modern Swift 6.2 package for one-finger rotation gestures with native SwiftUI support.
β¨ What's New
This is a complete modernization of the gesture recognizer from Objective-C to Swift 6.2:
- Native SwiftUI Integration - Simple
.oneFingerRotation()view modifier - Swift 6.2 with strict concurrency checking and
@MainActorsafety - iOS 17+ / macOS 14+ support
- Closure-based callbacks instead of delegates
- Performance optimized for smooth, responsive rotation tracking
- Comprehensive documentation with examples and best practices
π Quick Start
import SwiftUI
import OneFingerRotationGesture
struct ContentView: View {
@State private var rotation: CGFloat = 0
var body: some View {
Image(systemName: "dial.fill")
.resizable()
.frame(width: 200, height: 200)
.rotationEffect(.degrees(Double(rotation)))
.animation(nil, value: rotation)
.oneFingerRotation { angle in
rotation += angle
}
}
}π¦ Installation
Add to your project via Swift Package Manager:
.package(url: "https://github.com/melle/OneFingerRotationGesture", from: "1.0.0")π± Demo App
Run the included demo app (DemoApp/DemoApp.xcodeproj) to see it in action with:
- Visual touch area indicators
- Real-time angle tracking
- Smooth rotation performance
π Documentation
- README.md - Installation and usage guide
- EXAMPLES.md - Real-world examples (volume controls, color pickers, timers, etc.)
π Migration from Objective-C
Looking for the original Objective-C implementation? It's preserved in the objc branch.
π Credits
Based on my original concept from (2012).