title: Connecting wifi without internet not recognised with NetworkReachabilityManager or Reachability
body: <p>When trying to check internet connectivity I have a problem.
  When using alamofire NetworkReachabilityManager on a wifi with no internet like so:</p>
  <pre><code>import Alamofire
  
  class Connectivity {
  class func isConnectedToInternet() -&gt;Bool {
      return NetworkReachabilityManager()!.isReachable
   }
  }
  </code></pre>
  <p>This is the implementation:</p>
  <pre><code>    if Connectivity.isConnectedToInternet() {
          print(&quot;Yes! internet is available.&quot;)
      } else {
          print(&quot;No! internet is not available.&quot;)
      }
  </code></pre>
  <p>I am getting: &quot;Yes! internet is available.&quot; when there is no active internet connection (checked with Safari).</p>
  <p>Tried also this one with Reachability:</p>
  <pre><code>import Reachability
  
   class ReachabilityManager: NSObject {
  
  var reachability: Reachability!
  
  static let sharedInstance: NetworkManager = { return NetworkManager() }()
  
  
  override init() {
      super.init()
      
      reachability = Reachability()!
      
      NotificationCenter.default.addObserver(
          self,
          selector: #selector(networkStatusChanged(_:)),
          name: .reachabilityChanged,
          object: reachability
      )
      
      do {
          try reachability.startNotifier()
      } catch {
          print(&quot;Unable to start notifier&quot;)
      }
  }
  
  @objc func networkStatusChanged(_ notification: Notification) {
      // Do something globally here!
  }
  
  static func stopNotifier() -&gt; Void {
      do {
          try (NetworkManager.sharedInstance.reachability).startNotifier()
      } catch {
          print(&quot;Error stopping notifier&quot;)
      }
  }
  
  static func isReachable(completed: @escaping (NetworkManager) -&gt; Void) {
      if (NetworkManager.sharedInstance.reachability).connection != .none {
          completed(NetworkManager.sharedInstance)
      }
  }
  
  static func isUnreachable(completed: @escaping (NetworkManager) -&gt; Void) {
      if (NetworkManager.sharedInstance.reachability).connection == .none {
          completed(NetworkManager.sharedInstance)
      }
  }
  
  static func isReachableViaWWAN(completed: @escaping (NetworkManager) -&gt; Void) {
      if (NetworkManager.sharedInstance.reachability).connection == .cellular {
          completed(NetworkManager.sharedInstance)
      }
  }
  
  static func isReachableViaWiFi(completed: @escaping (NetworkManager) -&gt; Void) {
      if (NetworkManager.sharedInstance.reachability).connection == .wifi {
          completed(NetworkManager.sharedInstance)
      }
  }
  }
  </code></pre>
  <p>The implementation is:</p>
  <pre><code>NetworkManager.isReachable { networkManagerInstance in
      print(&quot;Network is available&quot;)
  }
  
  NetworkManager.isUnreachable { networkManagerInstance in
      print(&quot;Network is Unavailable&quot;)
  }
  </code></pre>
  <p>What am I doing wrong?</p>