setInterrupt(start:_:)

Executes a designated task at a scheduled time interval.

Timer.swift:118
func setInterrupt(start: Bool = true, _ callback: @escaping () -> Void)

Parameters

start

Whether to start the timer once it’s set, true by default.

callback

A task to execute once the time is up. It should be a void function without a return value.