loading playlist artwork like in the music app

205 Views Asked by At

I'm looking for an solution to display my artwork like in the apple music application. I'm able to load one artwork for the playlist but I want to be able to show 4 of the artworks as a playlist representative.

Currently I'm using this code for my playlist view

let objects = items.objectAtIndex(indexPath.item) as! MPMediaItemCollection
        let repObjects = objects.representativeItem

        cell.lbl_Name.text = objects.valueForProperty(MPMediaPlaylistPropertyName) as? String

        let artwork = repObjects?.valueForProperty(MPMediaItemPropertyArtwork)

        let artworkImage = artwork?.imageWithSize(CGSize(width: 130, height: 130))

        if(artworkImage != nil){
            cell.img_artwork.image = artworkImage
        }
        else{
            cell.img_artwork.image = UIImage(named: "no_Artwork.png")
        }

What would be the best way to go at this

0

There are 0 best solutions below