iOS Developer Library

Developer

Media Player Framework Reference MPMediaItemArtwork Class Reference

Options
Deployment Target:

On This Page
Language:

MPMediaItemArtwork

An MPMediaItemArtwork object, or media item artwork, represents a graphical image, such as music album cover art, associated with a media item. Media items are described in MPMediaItem Class Reference.

  • Creates and returns a UIImage object of a specified size.

    Declaration

    Swift

    func imageWithSize(_ size: CGSize) -> UIImage?

    Objective-C

    - (UIImage *)imageWithSize:(CGSize)size

    Parameters

    size

    The size, in points, for the new UIImage object.

    Discussion

    The returned image is the smallest available image that is at least as large as the requested size.

    Availability

    Available in iOS 3.0 and later.

  • init(image:) - initWithImage: Designated Initializer

    Initializes a media item artwork instance with a full-size image.

    Declaration

    Swift

    init(image image: UIImage)

    Objective-C

    - (instancetype)initWithImage:(UIImage *)image

    Parameters

    image

    The image to use to initialize the media item artwork instance.

    Discussion

    This method assumes that the crop rectangle of the image matches the bounds of the image, as defined by the image’s size in points. That is, this method assumes the image you supply is tightly cropped.

    Availability

    Available in iOS 5.0 and later.

  • The overall bounds, in points, of the image associated with the media item artwork.

    Declaration

    Swift

    var bounds: CGRect { get }

    Objective-C

    @property(nonatomic, readonly) CGRect bounds

    Availability

    Available in iOS 3.0 and later.

  • The bounds, in points, of the content area for the full size image associated with the media item artwork.

    Declaration

    Swift

    var imageCropRect: CGRect { get }

    Objective-C

    @property(nonatomic, readonly) CGRect imageCropRect

    Availability

    Available in iOS 3.0 and later.