可以使用 ReactiveCocoa 以某种方式限制更新下载0.3秒? 例如:
if (the_previous_update == indefinitely)
{
update;
}
if else (current_time - the_previous_update>=0.3)
{
the_previous_update = current_time;
update;
}
else{
do nothing;
}
答案 0 :(得分:4)
也许是这样的?
RACSignal *updateSignal = ... // a signal that sends a 'next' whenever download has progressed.
[[updateSignal throttle:0.3] subscribeNext:^(id x) {
updateUI();
}];
答案 1 :(得分:0)