MMMImageView

Objective-C

@interface MMMImageView : UIView

Swift

class MMMImageView : UIView

A limited replacement for UIImageView fixing its inability to properly work with images having non-zero alignmentRectInsets when scaled.

Note that this view is already constrained to the aspect ratio of the image’s alignment rect, so you should not use hard (equal) pins against both width and height or against all edges.

  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, nullable) UIImage *image

    Swift

    var image: UIImage? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, nullable) UIImage *highlightedImage

    Swift

    var highlightedImage: UIImage? { get set }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, getter=isHighlighted) BOOL highlighted

    Swift

    var isHighlighted: Bool { get set }
  • Undocumented

    Declaration

    Objective-C

    - (id)initWithImage:(nullable UIImage *)image highlightedImage:(nullable UIImage *)highlightedImage NS_DESIGNATED_INITIALIZER;

    Swift

    init(image: UIImage?, highlightedImage: UIImage?)
  • Convenience initializer.

    Declaration

    Objective-C

    - (nonnull id)init;

    Swift

    convenience init()
  • Convenience initializer.

    Declaration

    Objective-C

    - (nonnull id)initWithImage:(nullable UIImage *)image;

    Swift

    convenience init(image: UIImage?)
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (id)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    - (id)initWithCoder:(NSCoder *)aDecoder NS_UNAVAILABLE;