Latest 1.0
Homepage https://github.com/jberlana/JBCoundownLabel
License MIT
Platforms ios 6.0, requires ARC
Authors

A UILabel subclass that displays a countdown

CocoaPods to install JBCountdownLabel. Simply add the following line to your Podfile:

Podfile

pod 'JBCountdownLabel'

But you can also just drop JBCountdownLabel.m and JBCountdownLabel.h in your project.

Usage

Add the label to your view:

self.countdownLabel = [[JBCountdownLabel alloc] initWithFrame:CGRectMake(0, 50, 320, 46) format:@"Initiating ignition in %@" time:300 delegate:self];
self.countdownLabel.textColor = [UIColor colorWithRed:0.48 green:0.63 blue:0.07 alpha:1];
[self.view addSubview:self.countdownLabel];

You can change the countdown behaviour:

- (void)restartCountdown;
- (void)cancelCountdown;
- (void)setTime:(int)seconds;

There is an optional delegate callback to get notified when the countdown ended:

- (void)countdownFinnishInCountdown:(JBCountdownLabel *)countdown;

Demo

Build and run the JBCoundownLabelSampleProject project in Xcode to see JBCountdownLabel in action.

This code has been created originally to provide a countdown on the activation screen of meets Download the app and test it for free! Feedback is welcome!

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Contact

Javier Berlana

License

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

meets, create and discover plans with your friends.

Latest podspec

{
    "name": "JBCountdownLabel",
    "version": "1.0",
    "summary": "A UILabel subclass that displays a countdown",
    "platforms": {
        "ios": "6.0"
    },
    "description": "                   JBCountdownLabel is UILabel subclass that displays a countdown with a defined amount of seconds. So you can customise the label just like a native `UILabel` and add some cool actionsn",
    "homepage": "https://github.com/jberlana/JBCoundownLabel",
    "screenshots": "https://raw.githubusercontent.com/jberlana/JBCoundownLabel/master/demo.gif",
    "license": "MIT",
    "authors": {
        "Javier Berlana": "[email protected]"
    },
    "social_media_url": "http://twitter.com/jberlana",
    "source": {
        "git": "https://github.com/jberlana/JBCoundownLabel.git",
        "tag": "1.0"
    },
    "source_files": [
        "JBCountdownLabelSampleProject/JBCountdownLabel.h",
        "JBCountdownLabelSampleProject/JBCountdownLabel.m"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This