UI Component to display items in UIPickerView based on range selection.
Enhance the user experience by using a RangePicker.
RangePicker Docs describe how to integrate the framework.
- iOS 11.0+
- Xcode 14+
- Swift 5.8+
RangePickerView is distributed via Swift Package Manager which is the only official distribution tool by Apple. You can add RangePickerView to your project from Xcode's File > Swift Packages > Add Package Dependency
menu with its github URL:
https://github.com/mobven/RangePicker.git
import RangePicker
@IBOutlet var rangePickerView: RangePickerView!
let rangePickerView = RangePickerView()
rangePickerView.delegate = self
rangePickerView.range = (minimum: 100, maximum: 200)
self.view.addSubviews(rangePickerView)
You can easily customize the RangePicker
with editing Configuration
properties.
Property | Type | Description |
---|---|---|
alignment |
RangePickerView.Alignment |
The value for vertical or horizontal. |
range |
Int |
The minimum and maximum value for selection. |
valueType |
String |
The type of value to select. (Kg, cm etc.) |
visibilityRange |
Int |
The range of elements to display. |
selectedIndex |
Int |
A zero-indexed number identifying selection of the range picker view. |
selectRow |
Int |
Select row of the picker view. |
seperatorBackgroundColor |
UIColor |
The background color of the separator view. |
valueFont |
UIFont |
The font for the value label's text. |
valueTextColor |
UIColor |
The text color for the value label's text. |
unitFont |
UIFont |
The font for the unit label's text. |
unitTextColor |
UIColor |
The text color for the unit label's text. |
You can customize properties like this,
rangePickerView.alignment = .horizontal
rangePickerView.valueType = "kg"
- [] SwiftUI representable code example.
- [] Unit Tests.
- [] Update value and unit label during active scrolling gesture.