Assigns a client to the specified target, which receives callbacks when the reachability of the target changes.


func SCNetworkReachabilitySetCallback(_ target: SCNetworkReachability, _ callout: SCNetworkReachabilityCallBack?, _ context: UnsafeMutablePointer<SCNetworkReachabilityContext>?) -> Bool



The network reference associated with the address or name to be checked for reachability.


The function to be called when the reachability of the target changes. If NULL, the current client for the target is removed.


The reachability context associated with the callout. This value may be NULL.

Return Value

TRUE if the notification client was successfully set; otherwise, FALSE.

See Also

Preparing to Determine Reachability

func SCNetworkReachabilityGetTypeID() -> CFTypeID

Returns the type identifier of all SCNetworkReachability instances.

func SCNetworkReachabilityScheduleWithRunLoop(SCNetworkReachability, CFRunLoop, CFString) -> Bool

Schedules the specified network target with the specified run loop and mode.

func SCNetworkReachabilityUnscheduleFromRunLoop(SCNetworkReachability, CFRunLoop, CFString) -> Bool

Unschedules the specified target from the specified run loop and mode.

func SCNetworkReachabilitySetDispatchQueue(SCNetworkReachability, DispatchQueue?) -> Bool

Schedules callbacks for the specified target on the specified dispatch queue.