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 ]
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,479评论 0 23
  • 浅析40岁以后的程序员都干什么去了? 对于这个问题,我以自身为例子来做回答。我是98年毕业的计算机系本科生,我的同...
    zxqwan0430阅读 16,370评论 0 1
  • 等不及喵姐撸完星战一二三四五六七的取景地(不负责任地承诺,下周出星战取景地文),绘里酱在脑残粉柳公子的多次明示暗示...
    足记阅读 4,032评论 0 0
  • 在这样一个飘着雪的夜里 我的心灵是安静 安静的想去倾听 雪花落地 噗簌噗簌的声音 遥遥思念,牵挂着乡里 家中可摆着...
    云外楼头阅读 1,534评论 4 4