Contents

PlaygroundValue

The types you can save in the key-value store or send in messages to live views.

Declaration

enum PlaygroundValue

Overview

The example below stores a dictionary in a PlaygroundValue instance and then stores the value in a PlaygroundKeyValueStore.

let myData = [
    "animal": PlaygroundValue.string("Llama"),
    "count": PlaygroundValue.integer(5)
]

PlaygroundKeyValueStore.current.keyValueStore["AnimalCountDict"] = .dictionary(myData)

For information about using PlaygroundValue instances to send messages, see Send and Receive Messages.

Topics

Representing Data

Representing Data Collections

See Also

Data Persistence