---
title: "receive(_:)"
framework: playgroundsupport
role: symbol
role_heading: Instance Method
path: playgroundsupport/playgroundliveviewmessagehandler/3029540-receive
---

# receive(_:)

Allows the handler to receive a live view message from a remote object.

## Declaration

```swift
func receive(_ message: PlaygroundValue)
```

## Parameters

- `message`: A message sent to a live view from a remote object.

## Discussion

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. }
