Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I added this because a project I'm working on needed it - I figured it'd be better offering it than not, even if you decide not to merge it.
I wanted to offer the user a choice of only updating in the background when they're on Wifi. Easy enough.
However, it gets a bit complicated - what if I arrive at my location, then 20 seconds later I connect to Wifi? I'd expect the locationChanged block to be called at that point, and everything then continue as normal.
So that's what this is. Unfortunately I've had to add a Reachability class to get the network updates - perhaps there's a better way - and I've started adding prefixes (although I never got around to the SJONetworkStatus enum values) so it doesn't clash with any other Reachability class.