As mentioned before, the reverse geocoder will be updated every 10 seconds. We can do this using the NSTimer
signal that we have completed. However, let's try something different now. What about using another scheduler?
We learned in the previous chapter how to use UIScheduler
. However, there are more schedulers.
ReactiveCocoa brings a protocol called DateSchedulerType
, which is used to trigger the signal according to time intervals. As it is a protocol, we can't instantiate it. We have to use a class that implements this protocol.
There is one class called QueueScheduler
that implements DateSchedulerType
. The only detail that we have to give to this class is the GCD queue that we desire to use. Here, we are going to use the main queue. However, for better performance, you can try to create your own queue afterwards.
Scroll up to the beginning of the viewDidLoad
method and create a signal that is fired every 10 seconds, called tenSecondsSignal
, with the following code...