ReachabilityManagerType
public protocol ReachabilityManagerType
The ReachabilityManagerType describes entities that listen for reachability changes of hosts
and addresses for both WWAN and WiFi network interfaces.
They can be used to determine background information about why a network operation failed, or to retry network requests when a connection is established. It should not be used to prevent a user from initiating a network request, as it’s possible that an initial request may be required to establish reachability.
-
The current network reachability status.
Declaration
Swift
var networkReachabilityStatus: NetworkReachabilityStatus { get } -
Sets a closure executed when the network reachability status changes.
Declaration
Swift
func registerListener(_ listener: @escaping ReachabilityStatusListener) -
Starts listening for changes in network reachability status.
Declaration
Swift
@discardableResult func startListening() -> BoolReturn Value
trueif listening was started successfully,falseotherwise. -
Stops listening for changes in network reachability status.
Declaration
Swift
func stopListening() -
isReachableExtension methodWhether the network is currently reachable.
Declaration
Swift
var isReachable: Bool { get } -
isReachableOnWWANExtension methodWhether the network is currently reachable over the WWAN interface.
Declaration
Swift
var isReachableOnWWAN: Bool { get } -
isReachableOnEthernetOrWiFiExtension methodWhether the network is currently reachable over Ethernet or WiFi interface.
Declaration
Swift
var isReachableOnEthernetOrWiFi: Bool { get }
View on GitHub
ReachabilityManagerType Protocol Reference