I've scheduled a work with - (RACDisposable *)after:(NSDate *)date repeatingEvery:(NSTimeInterval)interval withLeeway:(NSTimeInterval)leeway schedule:(void (^)(void))block;. How to cancel it?
As far as I understood from description I should use RACDisposable* returned from this method.
Should I just call - dispose on this object?
Should It be configured somehow for cancelation?
Thanks
No, there's nothing else you need to do.
RACDisposable just represents a cancelable action, or resources to clean up. In the same way that you invoke -dispose to cancel a subscription, you can use it to cancel a recurring scheduled block.
As an aside, the RACScheduler methods are fairly low-level, and having to invoke them directly is usually an indicator of overly imperative code. If you can, try to use existing RACSignal operators to accomplish what you want in a more functional way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With