Browse Source

Squashed commit of the following:

commit 3054fd6f09b8bb2caef04a2aab97aebe4f102ce6
Author: Mattt Thompson <m@mattt.me>
Date:   Sat May 17 12:25:08 2014 -0700

    Minor refactoring of userInfo into separate declaration

commit 936ccb74eea302e4ee9b174fd80a8b72d62367bb
Author: Kyle Fuller <inbox@kylefuller.co.uk>
Date:   Sat May 17 12:23:51 2014 -0700

    Setting notification object to self

commit b9b6e6148a8ed5698daae9696d10656af4a39763
Merge: a2040b5 509fedb
Author: Mattt Thompson <m@mattt.me>
Date:   Sat May 17 12:21:24 2014 -0700

    Merge branch 'master' of github.com:cellularmitosis/AFNetworking into cellularmitosis-master

commit 509fedbfb56c1ff2f8741b1b3d25198b4a018fd1
Author: Jason Pepas <jpepas@uship.com>
Date:   Thu May 15 15:55:40 2014 -0500

    Adding notification for initial change from AFNetworkReachabilityStatusUnknown to any other state.
Mattt Thompson 11 years ago
parent
commit
80cb0e077e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      AFNetworking/AFNetworkReachabilityManager.m

+ 4 - 0
AFNetworking/AFNetworkReachabilityManager.m

@@ -188,6 +188,10 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
         if (strongSelf.networkReachabilityStatusBlock) {
             strongSelf.networkReachabilityStatusBlock(status);
         }
+
+        NSDictionary *userInfo = @{ AFNetworkingReachabilityNotificationStatusItem: @(status) };
+        NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+        [notificationCenter postNotificationName:AFNetworkingReachabilityDidChangeNotification object:strongSelf userInfo:userInfo];
     };
 
     SCNetworkReachabilityContext context = {0, (__bridge void *)callback, AFNetworkReachabilityRetainCallback, AFNetworkReachabilityReleaseCallback, NULL};