receive(_:)
Allows the handler to receive a live view message from a remote object.
Declaration
func receive(_ message: PlaygroundValue)Parameters
- message:
A message sent to a live view from a remote object.
Discussion
The example below implements this method to receive a dictionary with a command from a remote object.
func receive(_ message: PlaygroundValue) {
guard case let .dictionary(dict) = message else { return }
guard case let .string(commandName)? = dict["command"] else { return }
// Use commandName to perform the specified command.
}