Giter Site home page Giter Site logo

ipdecimalnumberpad's Introduction

IPDecimalNumberPad

[![CI Status](http://img.shields.io/travis/Nick Servidio/IPDecimalNumberPad.svg?style=flat)](https://travis-ci.org/Nick Servidio/IPDecimalNumberPad) Version License Platform

Usage

Demo Gif

Many apps require a user to enter in a decimal value with a number pad. Oftentimes this is accomplished with a keyboard. However, displaying a number pad within your UI can also provide an enjoyable user experience (see Square Cash and Venmo). One particularly common use case is the need for users to enter an amount of currency into an app.

The classes in this library provide a quick way to introduce a number pad into your app. For those who want to get started immediately, use the IPDecimalNumberPadController. This class includes a number pad and an accompanying label that displays the value entered as US dollars.

You can change the display of this class by hiding the amountLabel property and overriding the method:

- (void)handleCurrentAmountUpdate:(NSString *)currentAmount

You can then update a different UILabel or another element that displays text. You can adjust the insets surrounding the number pad to reposition it within the IPDecimalNumberPadController.

You can also customize the IPDecimalNumberPad itself. You can assign a value to the number pad’s buttonClass property. The number pad will then use this class to instantiate the buttons included in its UI. You can also provide a rowDividerImage, columnDividerImage, and deleteButtonImage. The IPDecimalNumberPad automatically creates resizable images from the row and column divider images that you supply.

For those looking for complete customization, you can use the IPDecimalNumberPad in your own UIViewController subclass. You can use the included IPStringBackedDecimalValue to hold the current value entered into the number pad, or create your own model.

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

IPDecimalNumberPad is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "IPDecimalNumberPad"

Author

Nick Servidio, [email protected]

License

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

ipdecimalnumberpad's People

Contributors

nservidio avatar

Stargazers

Jignesh Fadadu avatar Matt Sabath avatar

Watchers

Glenn R. Martin avatar  avatar Ying Quan Tan avatar James Cloos avatar Patrick Butkiewicz avatar Intrepid Pursuits avatar  avatar logan avatar  avatar

ipdecimalnumberpad's Issues

`pod try` doesn't work

the example project fails with a compile error:

/var/folders/1g/lbv8yq4n4158tyzvkqfgt03m0000gn/T/CocoaPods/Try/IPDecimalNumberPad/Pod/Classes/IPDecimalNumberPad.m:10:9: 'UIView+Constraints.h' file not found

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.