@protocol HUBComponentRegistry <NSObject>
Protocol defining the public API of a Hub component registry
A component registry manages a series of registered
that are used to create components for Hub Framework-powered views. To integrate a component
with the framework - implement a
HUBComponentFactory and register it with the registry.
You don’t conform to this protocol yourself, instead the application’s
setup with a registry that you can use.
Register a component factory with the Hub Framework
The registered factory will be used to create components whenever a component model declared the given component namespace as part of its
- (void)registerComponentFactory: (nonnull id<HUBComponentFactory>)componentFactory forNamespace:(nonnull NSString *)componentNamespace;
The factory to register
The namespace to register the factory for
Unregister a component 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.
- (void)unregisterComponentFactoryForNamespace: (nonnull NSString *)componentNamespace;
The namespace of the factory to unregister
Create a new component instance for a model
Normally, you don’t have to call this method yourself. Instead, the Hub Framework automatically creates component instances for the models you delcare in a content operation.
The model to create a component for
A newly created component that is ready to use. The component registry will first attempt to resolve a component factory for the model’s
componentNamespace, and ask it to create a component. However, if this fails, the registry will use its fallback handler to create a fallback component for the model’s