UAActionResult
@interface UAActionResult : NSObject
A class that holds the results of running an action, with optional metadata.
-
The result value produced when running an action (can be nil).
Declaration
Objective-C
@property (readonly, strong, nonatomic, nullable) id value;
Swift
var value: Any? { get }
-
An optional UAActionFetchResult that can be set if the action performed a background fetch.
Declaration
Objective-C
@property (readonly, assign, nonatomic) UAActionFetchResult fetchResult;
Swift
var fetchResult: UAActionFetchResult { get }
-
An optional error value that can be set if the action was unable to perform its work successfully.
Declaration
Objective-C
@property (readonly, strong, nonatomic, nullable) NSError *error;
Swift
var error: Error? { get }
-
The action’s run status.
Declaration
Objective-C
@property (readonly, assign, nonatomic) UAActionStatus status;
Swift
var status: UAActionStatus { get }
-
Creates a UAActionResult with the supplied value. The
fetchResult
anderror
properties default to UAActionFetchResultNoData and nil, respectively.Declaration
Objective-C
+ (nonnull instancetype)resultWithValue:(nullable id)value;
Swift
convenience init(value: Any?)
Parameters
value
An id typed value object.
Return Value
An instance of UAActionResult.
-
Creates a UAActionResult with the supplied value and fetch result. The
error
property defaults to nil.Declaration
Objective-C
+ (nonnull instancetype)resultWithValue:(nullable id)result withFetchResult:(UAActionFetchResult)fetchResult;
Swift
convenience init(value result: Any?, with fetchResult: UAActionFetchResult)
Parameters
result
An id typed value object.
fetchResult
A UAActionFetchResult enum value.
Return Value
An instance of UAActionResult.
-
Creates an
empty
UAActionResult with the value, fetch result and error set to nil, UAActionFetchResultNoData, and nil, respectively.Declaration
Objective-C
+ (nonnull instancetype)emptyResult;
Swift
class func empty() -> Self
-
Creates a UAActionResult with the value and fetch result set to nil and UAActionFetchResultNoData, respectively. The
error
property is set to the supplied argument.Declaration
Objective-C
+ (nonnull instancetype)resultWithError:(nonnull NSError *)error;
Swift
convenience init(error: Error)
Parameters
error
An instance of NSError.
-
Creates a UAActionResult with the value set to nil. The
error
andfetchResult
properties are set to the supplied arguments.Declaration
Objective-C
+ (nonnull instancetype)resultWithError:(nonnull NSError *)error withFetchResult:(UAActionFetchResult)fetchResult;
Swift
convenience init(error: Error, with fetchResult: UAActionFetchResult)
Parameters
error
An instance of NSError.
fetchResult
A UAActionFetchResult enum value.