I am using JSONSerialization quite often in my project.
Here is an example of my JSONSerialization code:
let json = try JSONSeriali
Options: [] is an empty array returns nothing.
Whereas Options: [] can also be amend with:
NSJSONWritingOptions: for writing JSON data like.
NSJSONWritingOptions.NSJSONWritingPrettyPrinted: Specifies that the JSON data should be generated with whitespace designed to make the output more readable. If this option is not set, the most compact possible JSON representation is generated.NSJSONReadingOptions: used when creating Foundation objects from JSON data.
NSJSONReadingOptions.MutableContainers: Specifies that arrays and dictionaries are created as mutable objects..mutableLeaves: Specifies that leaf strings in the JSON object graph are created as instances of NSMutableString..allowFragments: Specifies that the parser should allow top-level objects that are not an instance of NSArray or NSDictionary.