UAActionResult

Objective-C


@interface UAActionResult : NSObject

Swift

class ActionResult : NSObject

A class that holds the results of running an action, with optional metadata.

Action Result Properties

  • The result value produced when running an action (can be nil).

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, 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 (nonatomic, readonly) UAActionFetchResult fetchResult;

    Swift

    var fetchResult: ActionFetchResult { get }
  • An optional error value that can be set if the action was unable to perform its work successfully.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSError *error;

    Swift

    var error: Error? { get }
  • The action’s run status.

    Declaration

    Objective-C

    @property (nonatomic, readonly) UAActionStatus status;

    Swift

    var status: ActionStatus { get }

Action Result Creation

  • Creates a UAActionResult with the supplied value. The fetchResult and error 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: ActionFetchResult)

    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 and fetchResult 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: ActionFetchResult)

    Parameters

    error

    An instance of NSError.

    fetchResult

    A UAActionFetchResult enum value.

  • Creates an action result that indicates the arguments were rejected.

    Declaration

    Objective-C

    + (nonnull instancetype)rejectedArgumentsResult;

    Swift

    class func rejectedArguments() -> Self
  • Creates an action result that indicates the action was not found.

    Declaration

    Objective-C

    + (nonnull instancetype)actionNotFoundResult;

    Swift

    class func actionNotFound() -> Self