UAActionRunner

Objective-C

@interface UAActionRunner : NSObject

Swift

class UAActionRunner : NSObject

A helper class for running actions by name or by reference.

Action Runner Core Methods

  • Runs a registered action with the given name.

    If the action is not registered the completion handler will be called immediately with [UAActionResult emptyResult]

    Declaration

    Objective-C

    + (void)runActionWithName:(nonnull NSString *)actionName
                        value:(nullable id)value
                    situation:(UASituation)situation;

    Swift

    class func runAction(withName actionName: String, value: Any?, situation: UASituation)

    Parameters

    actionName

    The name of the action to run

    value

    The action’s argument value.

    situation

    The action’s situation.

  • Runs a registered action with the given name.

    If the action is not registered the completion handler will be called immediately with [UAActionResult emptyResult]

    Declaration

    Objective-C

    + (void)runActionWithName:(nonnull NSString *)actionName
                        value:(nullable id)value
                    situation:(UASituation)situation
                     metadata:(nonnull NSDictionary *)metadata;

    Swift

    class func runAction(withName actionName: String, value: Any?, situation: UASituation, metadata: [AnyHashable : Any])

    Parameters

    actionName

    The name of the action to run

    value

    The action’s argument value.

    situation

    The action’s situation.

    metadata

    The action’s metadata.

  • Runs a registered action with the given name.

    If the action is not registered the completion handler will be called immediately with [UAActionResult emptyResult]

    Declaration

    Objective-C

    + (void)runActionWithName:(nonnull NSString *)actionName
                        value:(nullable id)value
                    situation:(UASituation)situation
            completionHandler:(nonnull UAActionCompletionHandler)completionHandler;

    Swift

    class func runAction(withName actionName: String, value: Any?, situation: UASituation, completionHandler: @escaping UAActionCompletionHandler)

    Parameters

    actionName

    The name of the action to run

    value

    The action’s argument value.

    situation

    The action’s situation.

    completionHandler

    Optional completion handler to run when the action completes.

  • Runs a registered action with the given name.

    If the action is not registered the completion handler will be called immediately with [UAActionResult emptyResult]

    Declaration

    Objective-C

    + (void)runActionWithName:(nonnull NSString *)actionName
                        value:(nullable id)value
                    situation:(UASituation)situation
                     metadata:(nullable NSDictionary *)metadata
            completionHandler:(nullable UAActionCompletionHandler)completionHandler;

    Swift

    class func runAction(withName actionName: String, value: Any?, situation: UASituation, metadata: [AnyHashable : Any]?, completionHandler: UAActionCompletionHandler? = nil)

    Parameters

    actionName

    The name of the action to run

    value

    The action’s argument value.

    situation

    The action’s situation.

    metadata

    The action’s metadata.

    completionHandler

    Optional completion handler to run when the action completes.

  • Runs an action.

    Declaration

    Objective-C

    + (void)runAction:(nonnull UAAction *)action
                value:(nullable id)value
            situation:(UASituation)situation;

    Swift

    class func run(_ action: UAAction, value: Any?, situation: UASituation)

    Parameters

    action

    The action to run

    value

    The action’s argument value.

    situation

    The action’s situation.

  • Runs an action.

    Declaration

    Objective-C

    + (void)runAction:(nonnull UAAction *)action
                value:(nullable id)value
            situation:(UASituation)situation
             metadata:(nullable NSDictionary *)metadata;

    Swift

    class func run(_ action: UAAction, value: Any?, situation: UASituation, metadata: [AnyHashable : Any]?)

    Parameters

    action

    The action to run

    value

    The action’s argument value.

    situation

    The action’s situation.

    metadata

    The action’s metadata.

  • Runs an action.

    Declaration

    Objective-C

    + (void)runAction:(nonnull UAAction *)action
                    value:(nullable id)value
                situation:(UASituation)situation
        completionHandler:(nonnull UAActionCompletionHandler)completionHandler;

    Swift

    class func run(_ action: UAAction, value: Any?, situation: UASituation, completionHandler: @escaping UAActionCompletionHandler)

    Parameters

    action

    The action to run

    value

    The action’s argument value.

    situation

    The action’s situation.

    completionHandler

    Optional completion handler to run when the action completes.

  • Runs an action.

    Declaration

    Objective-C

    + (void)runAction:(nonnull UAAction *)action
                    value:(nullable id)value
                situation:(UASituation)situation
                 metadata:(nullable NSDictionary *)metadata
        completionHandler:(nullable UAActionCompletionHandler)completionHandler;

    Swift

    class func run(_ action: UAAction, value: Any?, situation: UASituation, metadata: [AnyHashable : Any]?, completionHandler: UAActionCompletionHandler? = nil)

    Parameters

    action

    The action to run

    value

    The action’s argument value.

    situation

    The action’s situation.

    metadata

    The action’s metadata.

    completionHandler

    Optional completion handler to run when the action completes.

  • Runs all actions in a given dictionary. The dictionary’s keys will be treated as action names, while the values will be treated as each action’s argument value.

    The results of all the actions will be aggregated into a single UAAggregateActionResult.

    Declaration

    Objective-C

    + (void)runActionsWithActionValues:(nonnull NSDictionary *)actionValues
                             situation:(UASituation)situation
                              metadata:(nullable NSDictionary *)metadata
                     completionHandler:
                         (nullable UAActionCompletionHandler)completionHandler;

    Swift

    class func runActions(withActionValues actionValues: [AnyHashable : Any], situation: UASituation, metadata: [AnyHashable : Any]?, completionHandler: UAActionCompletionHandler? = nil)

    Parameters

    actionValues

    The map of action names to action values.

    situation

    The action’s situation.

    metadata

    The action’s metadata.

    completionHandler

    CompletionHandler to call after all the actions have completed. The result will be the aggregated result of all the actions run.