title: how to check network change iphone
body: <p>I'm checking the network connection using this example from Apple:</p>
  
  <pre><code>- (void) checkNetworkStatus:(NSNotification *)notice
  {
      // called after network status changes
      NetworkStatus internetStatus = [internetReachable currentReachabilityStatus];
      switch (internetStatus)
      {
          case NotReachable:
          {
              NSLog(@"The internet is down.");
              self.internetActive = NO;
  
              break;
  
          }
          case ReachableViaWiFi:
          {
              NSLog(@"The internet is working via WIFI.");
              self.internetActive = YES;
  
              break;
  
          }
          case ReachableViaWWAN:
          {
              NSLog(@"The internet is working via WWAN.");
              self.internetActive = YES;
  
              break;
  
          }
      }
  
      NetworkStatus hostStatus = [hostReachable currentReachabilityStatus];
      switch (hostStatus)
      {
          case NotReachable:
          {
              NSLog(@"A gateway to the host server is down.");
              self.hostActive = NO;
  
              break;
  
          }
          case ReachableViaWiFi:
          {
              NSLog(@"A gateway to the host server is working via WIFI.");
              self.hostActive = YES;
  
              break;
  
          }
          case ReachableViaWWAN:
          {
              NSLog(@"A gateway to the host server is working via WWAN.");
              self.hostActive = YES;
  
              break;
  
          }
      }
  }
  </code></pre>
  
  <p>My intention is to first check that there's a connection and then send an email. The problem is that it takes too long to check if the the app can connect to a host let's say www.google.com it takes like almost a minute. Is there a faster way to check for this? </p>
  
  <p>The other question is how to check if the connection was changed from wi-fi to 3G. </p>
  
  <p>Thanks in advance! </p>