Latest 0.4.0
Homepage https://github.com/abouzek/ABCounterViewController
License MIT
Platforms ios 7.1, requires ARC
Authors

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, [email protected]

License

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

Latest podspec

{
    "name": "ABCounterViewController",
    "version": "0.4.0",
    "summary": "A minimalistic counter control",
    "description": "A minimalistic counter control with increment and decrement functionality. Includes the ability to set a starting, maximum and minimum values as well as text attributes.",
    "homepage": "https://github.com/abouzek/ABCounterViewController",
    "license": "MIT",
    "authors": {
        "abouzek": "[email protected]"
    },
    "source": {
        "git": "https://github.com/abouzek/ABCounterViewController.git",
        "tag": "0.4.0"
    },
    "social_media_url": "https://twitter.com/alanbouzek",
    "platforms": {
        "ios": "7.1"
    },
    "requires_arc": true,
    "source_files": "Pod/Classes/**/*",
    "resources": [
        "Pod/Assets/*.xib"
    ],
    "resource_bundles": {
        "ABCounterViewController": [
            "Pod/Assets/*.png"
        ]
    }
}

Pin It on Pinterest

Share This