SCPJSONDecodable

@protocol SCPJSONDecodable <NSObject>

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 (readonly, nonatomic) NSDictionary *_Nonnull originalJSON;

    Swift

    var originalJSON: [AnyHashable : Any] { get }