HUBContentReloadPolicy
@protocol HUBContentReloadPolicy <NSObject>
Protocol used to define objects that represent a policy for when the content for a view should be reloaded
To define a reload policy, conform to this protocol in a custom object and pass it when registering your
feature with HUBFeatureRegistry. A reload policy can be used to implement custom rules around when to
reload a given view.
Each application using the Hub Framework also has a default content reload policy used for features that
do not declare their own. This reload policy is passed when setting up HUBManager.
-
Return whether the content for a view should be reloaded
The Hub Framework will call this method every time a view that has already loaded a view model is about to appear on the screen. The passed
currentViewModelcan be used to inspect the current content of the view, as well as the view model’sbuildDateto determine whether a view should be reloaded or not.Declaration
Objective-C
- (BOOL)shouldReloadContentForViewURI:(nonnull NSURL *)viewURI currentViewModel: (nonnull id<HUBViewModel>)currentViewModel;Parameters
viewURIThe URI of the view
currentViewModelThe current view model of the view
View on GitHub
Install in Dash
HUBContentReloadPolicy Protocol Reference