SKYResponse

@interface SKYResponse : NSObject

encapsulates the response dictionary by providing convenient methods to access its content.

is a generic class that is expected to be subclassed to implement other common pattern of response dictionary.

  • Gets the response dictionary used to create the .

    Declaration

    Objective-C

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

    Swift

    var responseDictionary: [AnyHashable : Any] { get }
  • Gets the NSError that is contained within the responseDictionary or encountered when processing the responseDictionary.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSError *_Nullable error;

    Swift

    var error: Error? { get }
  • Instantiates an instance of .

    Subclass is expected to implement this to implement custom processing for the response dictionary.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)response;

    Swift

    init(dictionary response: [AnyHashable : Any])
  • Returns an instance of .

    Declaration

    Objective-C

    + (nonnull instancetype)responseWithDictionary:(nonnull NSDictionary *)response;
  • Sets the NSError that is contained within the responseDictionary or encountered when processing the responseDictionary.

    The NSError can be set once only. This is expected to be called by a subclass to set the NSError encountered.

    Declaration

    Objective-C

    - (void)foundResponseError:(nonnull NSError *)error;

    Swift

    func foundError(_ error: Error)