Skip to content

This is a subclass of UILabel which increments, this can be used as a counter in an Alarm clock app of a for keeping score.

Notifications You must be signed in to change notification settings

philmartin83/PMCountingLabel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

PMCountingLabel

This is a subclass of UILabel and when used can be used for counting as a timer or some sort of score display. To use follow these steps

let counter = PMCountingLabel()

// add to the subview as normal then call count function

like so:

counter.count(fromValue: 1, to: castScoreToFloat, withDuration: 5, withAnimationType: .EaseOut, withCounterType: .Int)

fromValue: the number you wish the counter to start from to: the number you wish the counter to stop at withDuration: the length of the time the counter should run for until it reaches its maximum value animationType: the style of animation counterType: if you require float values to display or int values to display

Animation Type:

there are currently 3 options of animation: Liner Ease In Ease Out

//MARK:- Enums
    //MARK: Animation Type
    enum PMCounterAnimationType {
        // add the ability to change our animation
        case Linear
        case EaseIn
        case EaseOut
    }
    
    //MARK: Counter Type
    enum PMCounterType{
        case Int
        case Float
    }

About

This is a subclass of UILabel which increments, this can be used as a counter in an Alarm clock app of a for keeping score.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages