HUBComponentWithImageHandling
@protocol HUBComponentWithImageHandling <HUBComponent>
Extended Hub component protocol that adds the ability to handle images
Use this protocol if your component will display images, either for itself or for any
child components that it could potentially be managing. See HUBComponent for more info.
-
Return the size that the component prefers that a certain image gets once loaded
Declaration
Objective-C
- (CGSize)preferredSizeForImageFromData: (nonnull id<HUBComponentImageData>)imageData model:(nonnull id<HUBComponentModel>)model containerViewSize:(CGSize)containerViewSize;Parameters
imageDataThe data that will be used to load the image
modelThe current model for the component
containerViewSizeThe size of the container in which the view will be displayed
-
Update the view to display an image that was loaded
Declaration
Objective-C
- (void)updateViewForLoadedImage:(nonnull UIImage *)image fromData:(nonnull id<HUBComponentImageData>)imageData model:(nonnull id<HUBComponentModel>)model animated:(BOOL)animated;Parameters
imageThe image that was loaded
imageDataThe data that was used to load the image
modelThe current model for the component
animatedWhether the update should be applied with an animation
View on GitHub
Install in Dash
HUBComponentWithImageHandling Protocol Reference