Feb 24, 2017 · 1 min read
Hi, question, since you only have 1 funcion in your delegate, couldn’t you just add a closure function to your list of listners? You would then don’t need a delegate and protocol. You only need to add code like this:
ReachabilityManager.shared.addListener { status in
switch status {
case .notReachable:
debugPrint(“ViewController: Network became unreachable”)
case .reachableViaWiFi:
debugPrint(“ViewController: Network reachable through WiFi”)
case .reachableViaWWAN:
debugPrint(“ViewController: Network reachable through Cellular Data”)
}
}
