Timer

  • Creates disposable timer and schedule it to invoke handler after delay

    Declaration

    Swift

    public class func schedule(delay: TimeInterval, handler: @escaping (Timer?) -> Void) -> Timer?

    Parameters

    delay

    Delay (seconds)

    handler

    Closure to be invoked

    Return Value

    Timer instance

  • Creates timer and schedule it to invoke handler after delay, repeating with specified interval

    Declaration

    Swift

    public class func schedule(delay: TimeInterval = 0.0, repeatInterval interval: TimeInterval, handler: @escaping (Timer?) -> Void) -> Timer?

    Parameters

    interval

    Repeating interval

    handler

    Closure to be invoked

    Return Value

    Timer instance