1

Hello Currently I am working with Afnetworking network reachability

 func CheckRechability() {

        AFNetworkReachabilityManager.shared().setReachabilityStatusChange {  (status: AFNetworkReachabilityStatus) in

            debugPrint(status.rawValue)

            switch (status.rawValue){

            case 0,-1:
                Print("No rechability")

                break

            case 1,2:
                Print("I have rechability")


                break
            default:

                break
            }
        }
        AFNetworkReachabilityManager.shared().startMonitoring()
    }

It works fine, but suppose I am connected with wifi and I have no internet connectivity it will give me reachability status. So my question is how to check that I have an internet connection or not whether I am connected to wifi or mobile connection.

Kushal Maniyar
  • 846
  • 1
  • 8
  • 26

1 Answers1

0

Reachability library can't tell you about internet connectivity ,for that mostly use to ping some server Use this Check for internet connection with Swift