I am using below code for making HTTP request in server.Now I want to know whether it is connected to internet or not. Below is my code
let request = Alam
If you goto NetworkReachabilityManager.swift you will see this
/// Whether the network is currently reachable. public var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi }
So I have written this in my APIhandlerClass
import AlamofireNetworkActivityIndicator
private let manager = NetworkReachabilityManager(host: "www.apple.com")
func isNetworkReachable() -> Bool {
return manager?.isReachable ?? false
}
So this tells me the status of network.