Skip to content

Latest commit

History

History
40 lines (29 loc) 路 806 Bytes

File metadata and controls

40 lines (29 loc) 路 806 Bytes

EXTENSION

Timer

public extension Timer

Methods

schedule(delay:handler:)

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

Schedule closure to run on main run loop after delay

  • Parameters:
    • delay: Delay interval
    • handler: Closure to run
  • Returns: CFRunLoopTimer

Parameters

Name Description
delay Delay interval
handler Closure to run

schedule(repeatInterval:handler:)

class func schedule(repeatInterval interval: TimeInterval, handler: @escaping () -> Void) -> CFRunLoopTimer?

Schedule closure to run on main run loop and repeat at the interval

  • Parameters:
    • interval: Interval
    • handler: Closure to run
  • Returns: CFRunLoopTimer