Skip to content

A minimalistic counter control with increment and decrement functionality.

License

Notifications You must be signed in to change notification settings

abouzek/ABCounterViewController

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ABCounterViewController

Version License Platform

Description

A minimalistic counter control with increment and decrement functionality. It includes the ability to set a starting, maximum and minimum values as well as text attributes.

Example

alt tag

Usage

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

An instance of ABCounterViewController should be created using the designated initializer:

-(instancetype) initWithDelegate:(id<ABCounterViewController)delegate
			  startCount:(float)startCount
                        minCount:(float)minCount
                        maxCount:(float)maxCount
                    stepInterval:(float)stepInterval
            numberTextAttributes:(NSDictionary *)numberTextAttributes
            buttonTextAttributes:(NSDictionary *)buttonTextAttributes
  • numberTextAttributes and buttonTextAttributes are standard text attribute NSDictionaries.
  • startCount determines the starting number, minCount and maxCount determine the minimum and maximum numbers the counter can reach.
  • stepInterval is the increment and decrement interval.

The delegate method:

-(void) counterViewController:(ABCounterViewController *)counterViewController
	         didUpdateToCount:(float)count

will be called each time the count is updated.

The frame must be set manually after initialization and looks best when the width is at least double the height.

Installation

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

pod "ABCounterViewController"

Author

abouzek, alan.bouzek@gmail.com

License

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

About

A minimalistic counter control with increment and decrement functionality.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages