SCPJSONDecodable

Objective-C

@protocol SCPJSONDecodable <NSObject>

Swift

protocol JSONDecodable : NSObjectProtocol

Objects conforming to this protocol can be instantiated by decoding a JSON dictionary.

  • Parses a JSON dictionary into an instance of the class. Returns nil if the object could not be decoded.

    Declaration

    Objective-C

    + (nullable instancetype)decodedObjectFromJSON:(nullable NSDictionary *)json;

    Swift

    static func decodedObject(fromJSON json: [AnyHashable : Any]?) -> Self?
  • The raw JSON used to create the object. This may be useful for accessing fields that haven’t yet been made into properties in the SDK.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSDictionary *_Nonnull originalJSON;

    Swift

    var originalJSON: [AnyHashable : Any] { get }