I am using Alamofire NetworkReachabilityManager for managing my connections like below.
let reachabilityManager = NetworkReachabilityManager()
reachabilityManager?.listener = { [weak self] status in
switch status {
case .notReachable:
self?.connectionType = .notReachable
break
case .unknown:
self?.connectionType = .notReachable
break
case .reachable(.ethernetOrWiFi):
self?.connectionType = .wifi
break
case .reachable(.wwan):
self?.connectionType = .cellular
break
}
public enum ReachabilityStatus {
case unknown
case notReachable
case wifi
case cellular
}
I am getting this callback when i am launching the application itself but I don't want this callback I need callback only when there is a change in network connection.
How can I solve this?