I like this block-based approach much more as opposed to listening for notifications or having a delegate callback on a central Reachability instance.
In most uses-cases I have seen so far you are probably just calling a method on the watching view controller and there it helps that the observer block can capture some state. Because of this we don’t need to use the C-level state passing.
At the time of this writing the code for DTReachability is now present on the develop branch of DTFoundation, it will be merged into master for the next release. Since it has a dependency on the SystemConfiguration.framework I put it into its own static lib and Cocoapods sub spec to use individually.
I am using this in AutoIngest for Mac now, but it should work without modification on iOS just the same. Your feedback is welcome.
Cocoanetics
Comments
Post a Comment