iOS Developer Library

Developer

MediaPlayer 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.

Inheritance


Conforms To


Import Statement


Swift

import MediaPlayer

Objective-C

@import MediaPlayer;

Availability


Available in iOS 3.0 and later.
  • 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.

    Import Statement

    Objective-C

    @import MediaPlayer;

    Swift

    import MediaPlayer

    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.

    Import Statement

    Objective-C

    @import MediaPlayer;

    Swift

    import MediaPlayer

    Availability

    Available in iOS 5.0 and later.

  • bounds bounds Property

    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

    Import Statement

    Objective-C

    @import MediaPlayer;

    Swift

    import MediaPlayer

    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

    Import Statement

    Objective-C

    @import MediaPlayer;

    Swift

    import MediaPlayer

    Availability

    Available in iOS 3.0 and later.