An object that converts between JSON and the equivalent Foundation objects.
Declaration
class JSONSerialization : NSObject
Overview
You use the JSONSerialization class to convert JSON to Foundation objects and convert Foundation objects to JSON.
A Foundation object that may be converted to JSON must have the following properties:
-
The top level object is an NSArray or NSDictionary.
-
All objects are instances of NSString, NSNumber, NSArray, NSDictionary, or NSNull.
-
All dictionary keys are instances of NSString.
-
Numbers are not NaN or infinity.
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.
developer.apple.com/documentation/foundation/jsonserialization
'Programming > Swift' 카테고리의 다른 글
Class: NSManagedObject (0) | 2020.11.11 |
---|---|
Class: UserDefaults (0) | 2020.11.10 |
Instance Method: dataTask(with:completionHandler:) (0) | 2020.11.08 |
NSError & CocoaError (0) | 2020.11.06 |
Error (0) | 2020.11.06 |