DownCounter

public final class DownCounter

DownCounter provides a simple counting down function.

Author

Adamas

Version

1.7.0

Date

03/05/2022
  • Create a counter

    Declaration

    Swift

    public init(queue: DispatchQueue = DispatchQueue.main)

    Parameters

    queue

    The queue that the timer should run on

  • Start counting

    Declaration

    Swift

    public func start(count: Int,
                      with interval: TimeInterval,
                      tickerHandler: ((Int) -> Void)?,
                      completionHandler: (() -> Void)?)

    Parameters

    count

    Number to count

    interval

    Time interval for each count

    tickerHandler

    Callback for each count

    completionHandler

    Callback when the counter finishes

  • Stop the counter

    Declaration

    Swift

    public func stop()