HUBManager
@interface HUBManager : NSObject
This class is the main entry point into the Hub Framework
An application using the Hub Framework should create a single instance of this class and retain it in a central location (such as its App Delegate). This class exposes the public API of the Hub Framework in a modular fashion, with each part of the API encapsulated in either a registry or a factory.
-
The registry used to register features with the framework. See the documentation for
HUBFeatureRegistryfor more info.Declaration
Objective-C
@property (readonly, strong, nonatomic) id<HUBFeatureRegistry> _Nonnull featureRegistry; -
The registry used to register components with the framework. See the documentation for
HUBComponentRegistryfor more info.Declaration
Objective-C
@property (readonly, strong, nonatomic) id<HUBComponentRegistry> _Nonnull componentRegistry; -
The registry used to register actions with the framework. See the documentation for
HUBActionRegistryfor more info.Declaration
Objective-C
@property (readonly, strong, nonatomic) id<HUBActionRegistry> _Nonnull actionRegistry; -
The registry used to register custom JSON schemas. See the documentation for
HUBJSONSchemaRegistryfor more info.Declaration
Objective-C
@property (readonly, strong, nonatomic) id<HUBJSONSchemaRegistry> _Nonnull JSONSchemaRegistry; -
The factory used to create view model loaders. See
HUBViewModelLoaderFactoryfor more info.Declaration
Objective-C
@property (readonly, strong, nonatomic) id<HUBViewModelLoaderFactory> _Nonnull viewModelLoaderFactory; -
The factory used to create view controllers. See
HUBViewControllerFactoryfor more info.Declaration
Objective-C
@property (readonly, strong, nonatomic) id<HUBViewControllerFactory> _Nonnull viewControllerFactory; -
The manager used to create component showcases. See
HUBComponentShowcaseManagerfor more info.Declaration
Objective-C
@property (readonly, strong, nonatomic) id<HUBComponentShowcaseManager> _Nonnull componentShowcaseManager; -
The service that can be used to enable live editing of Hub Framework-powered view controllers. Always
nilin release builds.Declaration
Objective-C
@property (readonly, strong, nonatomic, nullable) id<HUBLiveService> liveService; -
-initWithComponentLayoutManager:componentFallbackHandler:connectivityStateResolver:imageLoaderFactory:iconImageResolver:defaultActionHandler:defaultContentReloadPolicy:prependedContentOperationFactory:appendedContentOperationFactory:Initialize an instance of this class with all available customization options
In case you don’t want to use all of these customization options, see the initializers available in
HUBManager+Convenience.h.Declaration
Objective-C
- (nonnull instancetype) initWithComponentLayoutManager: (nonnull id<HUBComponentLayoutManager>)componentLayoutManager componentFallbackHandler: (nonnull id<HUBComponentFallbackHandler>)componentFallbackHandler connectivityStateResolver: (nullable id<HUBConnectivityStateResolver>)connectivityStateResolver imageLoaderFactory: (nullable id<HUBImageLoaderFactory>)imageLoaderFactory iconImageResolver: (nullable id<HUBIconImageResolver>)iconImageResolver defaultActionHandler: (nullable id<HUBActionHandler>)defaultActionHandler defaultContentReloadPolicy: (nullable id<HUBContentReloadPolicy>)defaultContentReloadPolicy prependedContentOperationFactory: (nullable id<HUBContentOperationFactory>)prependedContentOperationFactory appendedContentOperationFactory: (nullable id<HUBContentOperationFactory>)appendedContentOperationFactory;Parameters
componentLayoutManagerThe object to use to manage layout for components, computing margins using layout traits. See
HUBComponentLayoutManagerfor more information.componentFallbackHandlerThe object to use to fall back to default components in case a component couldn’t be resolved using the standard mechanism. See
HUBComponentFallbackHandlerfor more information.connectivityStateResolverAn object responsible for determining the current connectivity state of the application. If nil, a default implementation will be used, that uses the SystemConfiguration framework to determine connectivity.
imageLoaderFactoryAny custom factory that creates image loaders that are used to load remote images for components. If nil, a default image loader factory will be used. See
HUBImageLoaderFactoryfor more info.iconImageResolverAny object responsible for converting icons into renderable images. If nil, this instance of the Hub Framework won’t support icons. See
HUBIconImageResolverfor more information.defaultActionHandlerAny default action handler to use for features that do not define their own. An action handler enables execution of custom code instead of performing an action. See
HUBActionHandlerfor more information.defaultContentReloadPolicyAny default content reload policy to use for features that do not define their own. A content reload policy determines whenever a view belonging to the feature should have its content reloaded. If nil, any feature not defining its own reload policy will always be reloaded whenever a view that belongs to it re-appears. See
HUBContentReloadPolicyfor more information.prependedContentOperationFactoryAny content operation factory that should be prepended to the chain of content operation factories for all views. The operations that this factory produces will therefore always be prepended to the content loading chain of any view.
appendedContentOperationFactoryAny content operation factory that should be appended to the chain of content operation factories for all views. The operations that this factory produces will therefore always be appended to the content loading chain of any view.
-
Undocumented
Declaration
Objective-C
@interface HUBManager : NSObject -
Undocumented
Declaration
Objective-C
@interface HUBManager : NSObject -
Undocumented
Declaration
Objective-C
@interface HUBManager : NSObject
-
Create an instance of this class with a default configuration
This is the easiest way to setup the Hub Framework in an application. For more customization options, see this class’ designated initializer. The supplied
componentMarginwill be used to implement a defaultHUBComponentLayoutManager, and thecomponentFallbackBlockwill be used for a defaultHUBComponentFallbackHandler.Declaration
Objective-C
+ (nonnull instancetype) managerWithComponentMargin:(CGFloat)componentMargin componentFallbackBlock: (nonnull id<HUBComponent> _Nonnull (^)(HUBComponentCategory _Nonnull)) componentFallbackBlock;Parameters
componentMarginThe margin to use in between components. Margin will be applied between two components except when both of them are not stackable (vertical) or when one of them is full width (horizontal). For more information, see the
Layout programming guide
.componentFallbackBlockA block that should return a fallback component in case one couldn’t be resolved for a given component model. The block must always return a
HUBComponentinstance. -
Create an instance of this class with its required dependencies
This is a convenience initializer, to enable you to easily setup this class with the least amount of dependencies. For more customization options, see this class’ designated initializer.
Declaration
Objective-C
+ (nonnull instancetype) managerWithComponentLayoutManager: (nonnull id<HUBComponentLayoutManager>)componentLayoutManager componentFallbackHandler: (nonnull id<HUBComponentFallbackHandler>)componentFallbackHandler;Parameters
componentLayoutManagerThe object to use to manage layout for components, computing margins using layout traits. See
HUBComponentLayoutManagerfor more information.componentFallbackHandlerThe object to use to fall back to default components in case a component couldn’t be resolved using the standard mechanism. See
HUBComponentFallbackHandlerfor more information.
View on GitHub
Install in Dash
HUBManager Class Reference