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 implementingResultProtocol
should assign a classprivate(set)
variable to theerror
argument. “` public fileprivate(set) var error: Error?init(error: Error) { self.error = error } ”“
Declaration
Swift
init(error: Error)
-
error
Default implementationThe type of error.
Default Implementation
The type of error.
Declaration
Swift
var error: Error?
-
errorDescription
Default implementationThe detailed information of the error.
Default Implementation
The detailed information of the error.
Declaration
Swift
var errorDescription: String?
-
hasError
Default implementationThe 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.invalidDataFromServerDeclaration
Swift
static func parse(_ data: [String: Any]) throws -> Self