Instance Method

session(_:didReceiveUserInfo:)

Called when a data dictionary is received successfully.

Declaration

optional func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any] = [:])

Parameters

session

The session object of the current process.

userInfo

A dictionary of property list values representing the contents of the message. Use the contents of this dictionary to determine what course of action to take.

Discussion

The session object calls this method when it successfully receives a data dictionary from its counterpart. Implement this method and use it to incorporate the data into the app’s content.

This method is called on a background thread of your app.

See Also

Managing Data Dictionary Transfers

func session(WCSession, didFinish: WCSessionUserInfoTransfer, error: Error?)

Called when a data transfer operation finished successfully or because of an error.