TTResult
@interface TTResult<__covariant Result> : NSObject
A TTResult object encapsulates a generic value or an error, never both.
-
Creates a TTResult object with the specified generic result.
Declaration
Objective-C
- (instancetype)initWithResult:(Result)result;
Swift
init!(result: Result!)
Parameters
result
The result.
Return Value
TTResult object.
-
Creates a TTResult object with the specified error.
Declaration
Objective-C
- (instancetype)initWitError:(TTResponseError *)error;
Swift
init!(witError error: TTResponseError!)
Parameters
error
The error.
Return Value
TTResult object.
-
@property result @brief The encapsulated result value.
Declaration
Objective-C
@property (readonly, strong, nonatomic) Result result;
Swift
var result: Result! { get }
-
@property error @brief Encapsulated error value
Declaration
Objective-C
@property (readonly, strong, nonatomic) TTResponseError *error;
Swift
var error: TTResponseError! { get }