A wheel-like UI control component for choosing options from a menu.
Tap the following image to launch Appetize. The source for the demo app is available here.
import Rotary
struct Dancer: WheelOption {
let name: String
var wheelOptionTitle: String {
return name
}
}
let wheelControl = RotaryWheelControl<Dancer>()
wheelControl.rotationEnded = { [unowned self] dancer in
self.label.text = "The current selection is \(dancer.name)"
}
wheelControl.layout([
Dancer(name: "Joanne"),
Dancer(name: "Stacey"),
Dancer(name: "Rhian"),
Dancer(name: "Cathy"),
Dancer(name: "Robin")
])
wheelControl.styling = RotaryWheelStyling(
font: <placeholder>,
textColour: <placeholder>,
spindleColour: <placeholder>,
backgroundColour: <placeholder>,
innerGrooveColour: <placeholder>,
outerGrooveColour: <placeholder>
)
view.addSubview(wheelControl)
The closure 'rotationEnded' is called immediately after layout. If you do not want this behaviour, call layout before assigning the closure.
List this in your Package.swift
manifest file as a Swift Package dependency. Releases Page.
Heavily influenced by the awesome team over at raywenderlich.com.
link |
Stars: 0 |
Last commit: 3 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics