Timer(fireAt date … fires at date after it as well

TIL

init(fireAt date: Date, interval ti: TimeInterval, target t: Any, selector s: Selector, userInfo ui: Any?, repeats rep: Bool)

这里的date是第一次时间,也就是说你用了一个早于现在的时间,则会立即fire一次。

The date here is the “timer should first fire”, so if you setup a date earlier than now, timer would immediately fire once.

--

--