HUBComponentImageData

@protocol HUBComponentImageData <HUBSerializable>

Protocol defining the public API of an object that describes image data for a Component in the Hub Framework

You don’t conform to this protocol yourself, instead the Hub Framework will create implementations of it for you based on the data supplied to a HUBComponentImageDataBuilder or through JSON data.

  • Any identifier for the image

    This will always be nil for default images (main and background). For custom images, this property contains the same identifier as its key in the customImageData dictionary of its HUBComponentModel.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *identifier;
  • The type of the image

    If the type is HUBComponentImageTypeCustom, the identifier property will contain the custom identifier of the image. See HUBComponentImageType for more information.

    Declaration

    Objective-C

    @property (readonly, nonatomic) HUBComponentImageType type;
  • URL

    Any HTTP URL of a remote image that should be downloaded and then rendered

    The Hub Framework will take care of the image downloading itself, and will notify a component once that operation is completed, so a component normally doesn’t have to interact with this property itself.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSURL *URL;
  • Any icon to use as a placeholder before a remote image has been downloaded

    Icons can be converted into images of any size. See HUBIcon for more information.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) id<HUBIcon> placeholderIcon;
  • Any local image that should be used either as a placeholder image before the actual image has been dowloaded, or as a permanent image.

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nullable) UIImage *localImage;
  • Any custom data that is associated with the image data

    You can use custom data to easily add new pieces of data to an image data object, that can then be picked up by a component using the object.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable)
        NSDictionary<NSString *, id> *customData;