How do you schedule a block to run on the next run loop iteration?

后端 未结 5 2354
隐瞒了意图╮
隐瞒了意图╮ 2020-12-02 04:36

I want to be able to execute a block on the next run loop iteration. It\'s not so important whether it gets executed at the beginning or the end of the next run

5条回答
  •  醉话见心
    2020-12-02 05:20

    I wrote myself an NSObject category which accepts a variable delay value, based on another stackoverflow question. By passing a value of zero you are effectively making the code run on the next available runloop iteration.

提交回复
热议问题