Image

@interface Image : Visual

Reactively updates the image of an UIImageView whenever the state of its owner changes.

An Image can be configured with the following options:

  • showInitials - A Boolean indicating if the owner’s personalization should be shown (defaults TRUE).

  • initialsBuilder - A method that receives the initials and engraving as Strings and the ImageView that will be used and returns a map with the initials and a profile list (defaults the following method)


^NSDictionary *(NSString *initials, NSString *engraving, UIImageView *imageView) {

    NSString *initialsS = initials ?: @"";

    NSArray *profile = engraving != nil ? @[engraving] : @[];

    return @{

       @"initials": initialsS ?: @"",

       @"profile": profile

    };

};

  • A Boolean indicating if the owner’s personalization should be shown (defaults to TRUE).

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) BOOL showInitials;

    Swift

    var showInitials: Bool { get set }
  • A method that returns a dictionary with initials and profiles for a given personalization.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) InitialsBuilder _Nonnull initialsBuilder;

    Swift

    var initialsBuilder: InitialsBuilder { get set }
  • Initials to be shown. Overrides the owner’s personalization.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) NSString *_Nonnull initials;

    Swift

    var initials: String { get set }
  • Initials to be shown. Overrides the owner’s personalization.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) NSString *_Nonnull engraving;

    Swift

    var engraving: String { get set }
  • url

    The current URL of the image.

    Declaration

    Objective-C

    @property (assign, readwrite, atomic) NSString *_Nonnull url;

    Swift

    var url: String { get set }
  • The UIImageView where the image will be displayed.

    Declaration

    Objective-C

    @property (readwrite, nonatomic) UIImageView *_Nullable imageView;

    Swift

    weak var imageView: UIImageView? { get set }
  • Constructor for an Image instance.

    Declaration

    Objective-C

    - (nonnull id)initWithImageView:(nonnull UIImageView *)imageView
                              owner:(nonnull Ripe *)owner
                            options:(nonnull NSDictionary *)options;

    Swift

    init(imageView: UIImageView, owner: Ripe, options: [AnyHashable : Any] = [:])

    Parameters

    imageView

    The UIImageView where the image will be displayed.

    owner

    The Ripe instance that will be presented.

    options

    An options map that allows the configuration of the Image instance.

    Return Value

    The Image instance created.