Skip to content

Commit

Permalink
Merge pull request #7 from miklselsoe/master
Browse files Browse the repository at this point in the history
Send notifications on the main thread.
  • Loading branch information
GlennChiu committed Jun 10, 2014
2 parents cfbb1cc + 3cce5f7 commit 49e9f0b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions GCNetworkReachability.m
Original file line number Diff line number Diff line change
Expand Up @@ -390,9 +390,11 @@ static void GCNetworkReachabilityCallbackWithBlock(SCNetworkReachabilityRef __un
static void GCNetworkReachabilityCallback(SCNetworkReachabilityRef __unused target, SCNetworkReachabilityFlags flags, void *info)
{
GCNetworkReachabilityStatus status = GCNetworkReachabilityStatusForFlags(flags);
[[NSNotificationCenter defaultCenter] postNotificationName:kGCNetworkReachabilityDidChangeNotification
object:(__bridge GCNetworkReachability *)info
userInfo:@{kGCNetworkReachabilityStatusKey : @(status)}];
dispatch_async(dispatch_get_main_queue(), ^{
[[NSNotificationCenter defaultCenter] postNotificationName:kGCNetworkReachabilityDidChangeNotification
object:(__bridge GCNetworkReachability *)info
userInfo:@{kGCNetworkReachabilityStatusKey : @(status)}];
});

GCNetworkReachabilityPrintFlags(flags);
}
Expand Down

0 comments on commit 49e9f0b

Please sign in to comment.