ResultProtocol

public protocol ResultProtocol

The ResultProtocol is for classes that parse a JSON result from on-premises or cloud.

  • Initialize an instance containing the exception.

    Remark

    Classes implementing ResultProtocol should assign a class private(set) variable to the error argument. “` public fileprivate(set) var error: Error?

    init(error: Error) { self.error = error } ”“

    Declaration

    Swift

    init(error: Error)
  • error Default implementation

    The type of error.

    Default Implementation

    The type of error.

    Declaration

    Swift

    var error: Error?
  • errorDescription Default implementation

    The detailed information of the error.

    Default Implementation

    The detailed information of the error.

    Declaration

    Swift

    var errorDescription: String?
  • hasError Default implementation

    The flag to indicate an error.

    Default Implementation

    The flag to indicate an error.

    Declaration

    Swift

    var hasError: Bool
  • Parses the object into an ResultProtocol.

    Throws

    IBMMobileKitError.serverError, IBMMobileKitError.invalidDataFromServer

    Declaration

    Swift

    static func parse(_ data: [String: Any]) throws -> Self