To run the example project, clone the repo, and run pod install from the Example directory first.
VRPicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "VRPicker"The VRPicker view is instantiated with an instance of VRPickerConfiguration and a CGRect for frame:
let config = VRPickerConfiguration(items: ...)
let pickerView = VRPicker(with: config, frame: .zero)The VRPickerDelegate protocol can be implemented to receive updates about which item is currently selected.
VRPickerConfiguration, which is used when instantiating an instance of VRPicker, holds the various properties which can be configured.
All configuration properties have default values.
The list of items to display in the picker. The items must conform to the protocol VRPickerItem, which extends CustomStringConvertible.
Which index should be selected when the picker is initialized.
Which font to use for the currently selected item.
Which font color to use for the currently selected item.
Which font to use for the non-selected items.
Which font color to use for the non-selected items.
The radius of the selection circle, in percent. (1.0 = 100 %)
Which background color to use for the selection circle.
gradientColors: [UIColor] (default value: [UIColor.white.withAlphaComponent(0.8), UIColor.white.withAlphaComponent(0)])
An array of gradient colors to use for the left and right sides.
The gradient width, in percent, of the entire picker width. (1.0 = 100 %)
Which position to use for the gradients, above or below the items.
Which width, in points, to use for the items.
Velocity coefficient for the scroll views.
Viktor Rutberg, wishie@gmail.com
VRPicker is available under the MIT license. See the LICENSE file for more info.
