reachableBlock will be called twice in iOS9
Hello Tony
Reachability 's reachableBlock will be called twice in iOS9.
I didn't see any report in there...
Can you check that?
Thanks
hi, same for me, reachableBlock called twice
Same for us as well.
I've been doing some tests around this, and it's actually a problem with Apple's SCNetworkReachabilty API. Sometimes the SCNetworkReachabilityCallBack is called once, but more often than not it's called twice.
I've created a little app to demo this.... https://github.com/kaylanx/ReachabilityTest
And I've filed a bug report with Apple.
The way I've always dealt with this is to use Rechability as the input to a state machine.
That is Reachability changes trigger changes to the state machine, the output of which actually tells your app what to do. e.g. multiple reachability changes to the same state only trigger one output from the state machine.
I've considered releasing the code as an additional layer on top of the base Reachability - When I get some time I'll try and clean it up and do that.
:+1: for that (hoping time comes to you easier than most of us).
@tonymillion Could you release the state machine as-is? I am running into this problem and wouldn't mind doing cleanup work on it while I have the interest and the time.