Coder Social home page Coder Social logo

miksu82 / jsktimerview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeffkibuule/jsktimerview

0.0 2.0 0.0 1.02 MB

A simple custom UIView that acts as a self-contained, animating timer.

License: MIT License

Objective-C 93.34% Ruby 1.59% C 0.58% Shell 4.49%

jsktimerview's Introduction

JSKTimerView

CI Status Version License Platform

GIF

Screenshot0 Screenshot1 Screenshot2 Screenshot3

JSKTimerView is a simple custom UIView that acts as a self-contained, animating timer.

  • Set up timer based in seconds
  • Start timer and have it animate automatically
  • Full control of timer: start, pause, stop, reset, and reset
  • Manually set timer progress and have timer update accordingly
  • Get notified when timer has finished
  • iOS 7+ and up

Usage

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

Requirements

  • iOS 7.0+
  • ARC

Installation

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

pod "JSKTimerView"

Getting Started

#import <JSKTimerView/JSKTimerView.h>    // Import the relevant header

Create a 60-sec timer

JSKTimerView *timerView = [[JSKTimerView alloc] init];
[timerView setTimerWithDuration:60];

Start a timer

[timerView startTimer];

Pause a timer

[timerView pauseTimer];

Stop a timer

[timerView stopTimer];

Reset a timer

[timerView resetTimer];

Restart a timer

[timerView restartTimer];

Set timer progress manually

// Progress should be a value between 0 and 1, timer value updates automatically
timerView.progress = 0.5;

Know when the timer naturally ends

// Assume self refers to object that implements timerDidFinish method of JSKTimerViewDelegate
timerView.setDelegate = self;

- (void)timerDidFinish {
    NSLog(@"Timer finished");
}

Author

Joefrey Kibuule, [email protected]

License

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

Copyright © 2015 Joefrey Kibuule.

Please provide attribution, it is greatly appreciated.

jsktimerview's People

Contributors

jeffkibuule avatar mikaristimaki avatar

Watchers

 avatar  avatar

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.