CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.

NumPad 3.0.1

NumPad 3.0.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Jan 2018
SwiftSwift Version 4.0
SPMSupports SPM

Maintained by Lasha Efremidze.



NumPad 3.0.1

  • By
  • Lasha Efremidze

NumPad

codebeat badge

Number Pad inspired by Square. This module is based on LEAmountInputView.

Demo

$ pod try NumPad

Installation

Manually

  1. Download and drop NumPad.swift in your project.
  2. Congratulations!

Usage

At first, import NumPad library:

import NumPad

Set the data source and delegate:

let numPad = NumPad()
numPad.dataSource = self
numPad.delegate = self
addSubview(numPad)

Or use the DefaultNumPad for a preconfigured NumPad:

let numPad = DefaultNumPad()
addSubview(numPad)

Data Source

// number of rows
func numberOfRowsInNumPad(numPad: NumPad) -> Int

// number of columns for row
func numPad(numPad: NumPad, numberOfColumnsInRow row: Row) -> Int

// item for position
func numPad(numPad: NumPad, itemAtPosition position: Position) -> Item

Delegate

// handle item tap
func numPad(numPad: NumPad, itemTapped item: Item, atPosition position: Position)

// item size for position
func numPad(numPad: NumPad, sizeForItemAtPosition position: Position) -> CGSize

Contributions

Contributions are totally welcome.

License

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