Show Album Image on Lock Screen

The following text is from Showing a lock screen image using MPNowPlayingInfoCenter doesn't work

Never mind I figured out.
If anyone want to learn you have to do the following

 let mpic = MPNowPlayingInfoCenter.defaultCenter()

// initialize an instance of MPMediaItemArtWork with a UIImage
 var albumArtWork = MPMediaItemArtwork(image: songs[currentAudioIndex].songImage)

// Then assign it to the MPNowPlayingInfoCenter
 mpic.nowPlayingInfo = [ MPMediaItemPropertyTitle:songs[currentAudioIndex].songName, MPMediaItemPropertyArtist:songs[currentAudioIndex].artistName, MPMediaItemPropertyArtwork:albumArtWork ]

你可能感兴趣的:(Show Album Image on Lock Screen)