WheelPicker is ...
import WheelPicker
struct ContentView: View {
@State private var circularWheelPickerSelection: Int = 0
@State private var finiteWheelPickerSelection: Int = 0
@State private var dateWheelPickerSelection: Date = Date()
let items: [Int] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
var body: some View {
VStack {
// Circular style picker
CircularWheelPicker(selection: $circularWheelPickerSelection, items: items) { value in
// value may be nil (If the label is out of range)
if let value = value {
Text("\(value)")
} else {
Text("")
}
}
// Finite style picker
FiniteWheelPicker(selection: $finiteWheelPickerSelection, items: items) { value in
// value may be nil (If the label is out of range)
if let value = value {
Text("\(value)")
} else {
Text("")
}
}
// Date select picker (Multiple columns)
DateWheelPicker(selection: $dateWheelPickerSelection) { date in
let components = Calendar.current.dateComponents([.weekday], from: date)
switch components.weekday {
case 1: return .red // Sunday
case 7: return .blue // Saturday
default: return nil
}
}
}
}
}
Before contribute check the CONTRIBUTING file for more info.
Follow these 3 steps to run Example project: clone WheelPicker repository, open WheelPicker workspace and run the Example project.
https://github.com/tokiensis/WheelPicker.git
pod 'WheelPicker-SwiftUI', '~> 1.0.0'
github "tokiensis/WheelPicker" ~> 1.0.0
You can do it by conforming to .....
See CHANGELOG.
link |
Stars: 15 |
Last commit: 39 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics