【发布时间】:2019-01-02 10:40:37
【问题描述】:
我需要每秒减少输入值,然后打印出来。 当值达到 0 时,则变为 100,不断重复递减过程。
例如:
Given value:
-> 234
Timer starts decreasing with every second
-> 233
-> 232
...
-> 1
-> 0 and the whole process repeats,
but starts with value 100
(and again decreasing, reaches 0, starting from 100)
我知道如何在 Rx 中使用计时器,但是如何将它与描述的案例联系起来?
【问题讨论】:
标签: swift timer observable rx-swift