Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 number

self.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)
}
}
```
## Author

Yash Thaker, [email protected]

## License

NumberPicker is available under the MIT license. See the LICENSE file for more info.