J.Vongehr
J.Vongehr

Reputation: 333

Assign MPMediaItemArtwork to UIImage

I have a table view, where i display my songs via MPMedia. What i want is, that the album cover for each song gets displayed in the cell, too. I tried it the same way i did with song and artist:

cell?.textLabel?.text = items.title cell?.detailTextLabel?.text = items.artist cell?.imageView?.image = items.artwork

but I get the error "Cannot assign value of type MPMediaItemArtwork? to type UIImage?"

Anyone know how to do this? If you need more code just let me know.

Upvotes: 1

Views: 1299

Answers (1)

J.Vongehr
J.Vongehr

Reputation: 333

Found out, the answer is item.artwork.imageWithSize

Upvotes: 2

Related Questions