NetworkReachabilityMonitor
public class NetworkReachabilityMonitor : BaseMonitor
A NetworkReachabilityMonitor instance monitors a network node name or
address for changes to its reachability.
-
Encapsulates changes to the reachability of a network node name or address.
See moreDeclaration
Swift
public enum Event -
Encapsulates the reachability of a network node name or address.
See moreDeclaration
Swift
public enum Status -
Initializes a new
NetworkReachabilityMonitorfor the network address0.0.0.0(meaning “any IPv4 address at all”).Declaration
Swift
public init(queue: OperationQueue = .main, handler: @escaping (Event) -> Void) throwsParameters
queueThe operation queue on which the handler executes. By default, the main operation queue is used.
handlerThe handler to call when the reachability of the network node address changes.
-
Initializes a new
NetworkReachabilityMonitorfor the specified network node name.Declaration
Swift
public init(name: String, queue: OperationQueue = .main, handler: @escaping (Event) -> Void) throwsParameters
nameThe network node name of the desired host.
queueThe operation queue on which the handler executes. By default, the main operation queue is used.
handlerThe handler to call when the reachability of the network node name changes.
-
A Boolean value indicating whether the network node name or address can be reached.
Declaration
Swift
public var isReachable: Bool { get } -
A Boolean value indicating whether the network node name or address can be reached via a non-cellular connection.
Declaration
Swift
public var isReachableViaWiFi: Bool { get } -
A Boolean value indicating whether the network node name or address can be reached via a cellular connection.
Declaration
Swift
public var isReachableViaWWAN: Bool { get } -
The reachability of the network node name or address.
Declaration
Swift
public var status: Status { get } -
Declaration
Swift
override public func cleanupMonitor() -
Declaration
Swift
override public func configureMonitor()
View on GitHub
Install in Dash
NetworkReachabilityMonitor Class Reference