Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yashthaker7/numberpicker
Custom number picker
https://github.com/yashthaker7/numberpicker
customnumberpicker custompicker custompickerview gradientpicker gradientpickerview ios numberpicker swift swift4 uipickerview xcode
Last synced: 3 months ago
JSON representation
Custom number picker
- Host: GitHub
- URL: https://github.com/yashthaker7/numberpicker
- Owner: yashthaker7
- License: mit
- Created: 2018-06-14T17:56:18.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-27T15:58:34.000Z (over 5 years ago)
- Last Synced: 2024-03-14T20:53:32.232Z (11 months ago)
- Topics: customnumberpicker, custompicker, custompickerview, gradientpicker, gradientpickerview, ios, numberpicker, swift, swift4, uipickerview, xcode
- Language: Swift
- Homepage:
- Size: 6.73 MB
- Stars: 101
- Watchers: 3
- Forks: 19
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NumberPicker
[![Version](https://img.shields.io/cocoapods/v/NumberPicker.svg?style=flat)](https://cocoapods.org/pods/NumberPicker)
[![License](https://img.shields.io/cocoapods/l/NumberPicker.svg?style=flat)](https://cocoapods.org/pods/NumberPicker)
[![Platform](https://img.shields.io/cocoapods/p/NumberPicker.svg?style=flat)](https://cocoapods.org/pods/NumberPicker)A more interactive way to display and select number.
## Installation
NumberPicker is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'NumberPicker'
```How to use
---------
Call this function in action.
```swift
func openNumberPicker() {
let numberPicker = NumberPicker(delegate: self, maxNumber: 300) // set max number
numberPicker.bgGradients = [.red, .yellow]
numberPicker.tintColor = .white
numberPicker.heading = "Weight"
numberPicker.defaultSelectedNumber = 150 // set default selected numberself.present(numberPicker, animated: true, completion: nil)
}
```
### Customize
You can change gradient color and tint color and title
```swift
numberPicker.bgGradients = [.red, .yellow]
numberPicker.tintColor = .white
numberPicker.heading = "Weight"
```
### Delegate
```swift
extension ViewController: NumberPickerDelegate {func selectedNumber(_ number: Int) {
print(number)
}
}
```
## AuthorYash Thaker, [email protected]
## License
NumberPicker is available under the MIT license. See the LICENSE file for more info.