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)
Parameters
error
An instance of the
Error
representing the error.
-
error
Default implementationThe type of error.
Default Implementation
The type of error.
Declaration
Swift
var error: Error? { get }
-
errorDescription
Default implementationThe detailed information of the error.
Default Implementation
The detailed information of the error.
Declaration
Swift
var errorDescription: String? { get }
-
hasError
Default implementationThe flag to indicate an error.
Default Implementation
The flag to indicate an error.
Declaration
Swift
var hasError: Bool { get }
-
Parses the object into an
ResultProtocol
.Throws
IBMMobileKitError.serverError, IBMMobileKitError.invalidDataFromServerDeclaration
Swift
static func parse(_ data: [String : Any]) throws -> Self
Parameters
data
The object to deserialize from.
Return Value
Deserialized
ResultProtocol
.