Instance Method

sessionReachabilityDidChange(_:)

Called when the reachability of the counterpart session changes.

Declaration

optional func sessionReachabilityDidChange(_ session: WCSession)

Parameters

session

The session object of the current process. Use the isReachable property of this object to determine the reachability of the counterpart session.

Discussion

A session is reachable when the iOS app or WatchKit extension to which it belongs is active and running. This method is called to let the current process know that its counterpart session’s reachability changed. Use that information to make decisions about how you want to send information to the counterpart. For example, when the counterpart is reachable, you might send messages immediately rather than post them as an update.

See Also

Managing State Changes

func sessionWatchStateDidChange(WCSession)

Called when a feature is enabled or disabled.