writeJSONObject(_:to:options:error:)
Writes a given JSON object to a stream.
Declaration
class func writeJSONObject(_ obj: Any, to stream: OutputStream, options opt: JSONSerialization.WritingOptions = [], error: NSErrorPointer) -> IntParameters
- obj:
The object to write to
stream. - stream:
The stream to which to write.
The stream should be open and configured.
- opt:
Options for writing the JSON data.
See Writingoptions for possible values.
- error:
If an error occurs, upon return contains an
NSErrorobject with code Nspropertylistwriteinvaliderror Swift.var that describes the problem.
Return Value
The number of bytes written to the stream, or 0 if an error occurs.