LoginSignup
16
17

More than 5 years have passed since last update.

iOS8からのArtwork取得注意点

Posted at
    MPMediaItemArtwork *artwork = [content.mediaItem valueForProperty:MPMediaItemPropertyArtwork];
    UIImage *image = [artwork imageWithSize:CGSizeMake(250,250)];

このように今までは取得出来ましたが、iOS8からはimageWithSizeでサイズ指定を行う事はできなくなりました。

    MPMediaItemArtwork *artwork = [content.mediaItem valueForProperty:MPMediaItemPropertyArtwork];
    UIImage *image = [artwork imageWithSize:artwork.bounds.size];

iOS8からはこのようにMPMediaItemArtworkのサイズを指定し、生データを一度取得してからリサイズする必要があります。

16
17
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
17