Contents

JSONSerialization

An object that converts between JSON and the equivalent Foundation objects.

Declaration

class JSONSerialization

Overview

You use the JSONSerialization class to convert JSON to Foundation objects and convert Foundation objects to JSON.

To convert a Foundation object to JSON, the object must have the following properties:

Other rules may apply. Calling isValidJSONObject(_:) or attempting a conversion are the definitive ways to tell if the JSONSerialization class can convert given object to JSON data.

Topics

Creating a JSON Object

Creating JSON Data

See Also

JSON