I want to check if the wifi is off then show alert to the user to check his/her connectivity.

I find code like this but it checks if there is an internet connection, not checking if the wifi is on or off:

```
func isConnectionAvailble()->Bool{

  var rechability = SCNetworkReachabilityCreateWithName(kCFAllocatorDefault, "www.apple.com").takeRetainedValue()

  var flags : SCNetworkReachabilityFlags = 0

  if SCNetworkReachabilityGetFlags(rechability, &flags) == 0
  {
     return false
  }

  let isReachable = (flags & UInt32(kSCNetworkFlagsReachable)) != 0
  let needsConnection = (flags & UInt32(kSCNetworkFlagsConnectionRequired)) != 0
  return (isReachable && !needsConnection)
}

```