Class

JSONSerialization

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

Overview

An object that may be converted to JSON must have the following properties:

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

Nested Types

NSJSONWritingOptions

Options for writing JSON data.

NSJSONReadingOptions

Options used when creating Foundation objects from JSON data—see jsonObject(with:options:) and jsonObject(with:options:).

Symbols

Creating a JSON Object

Creating JSON Data

class func isValidJSONObject(Any)

Returns a Boolean value that indicates whether a given object can be converted to JSON data.

Constants

ReadingOptions

Options used when creating Foundation objects from JSON data—see jsonObject(with:options:) and jsonObject(with:options:).

WritingOptions

Options for writing JSON data.

Relationships

Inherits From

Conforms To