HUBActionRegistry
@protocol HUBActionRegistry <NSObject>
Protocol defining the public API of a Hub Framework action registry
An action registry manages a series of registered HUBActionFactory
implementations, that are
used to create actions for handling events occuring in Hub Framework-powered views. To integrate
actions with the framework - implement a HUBActionFactory
and register it with the registry.
You don’t conform to this protocol yourself, instead the application’s HUBManager
comes setup
with a registry that you can use.
-
Register an action factory with the Hub Framework
The registered factory will be used to create actions whenever an event’s action identifier contained the namespace that the factory was registered for.
Declaration
Objective-C
- (void)registerActionFactory:(nonnull id<HUBActionFactory>)actionFactory forNamespace:(nonnull NSString *)actionNamespace;
Parameters
actionFactory
The factory to register
actionNamespace
The namespace to register the factory for
-
Unregister an action factory from the Hub Framework
After this method has been called, the Hub Framework will remove any factory found for the given namespace, opening it up to be registered again with another factory. If the given namespace does not exist, this method does nothing.
Declaration
Objective-C
- (void)unregisterActionFactoryForNamespace:(nonnull NSString *)actionNamespace;
Parameters
actionNamespace
The namespace of the factory to unregister