Having trouble with MusicKit sample app provided by Apple

♀尐吖头ヾ 提交于 2019-12-06 21:44:38

I have found a similar question in the Apple's Dev Forums:

MPMusicPlayerController Swift4 - Ambiguous Use of Play

According to an entry writing a fix to work around the issue, you need to change this line in MusicPlayerManager.swift:

let musicPlayerController = MPMusicPlayerController.systemMusicPlayer

(musicPlayerController's type becomes MPMusicPlayerController & MPSystemMusicPlayerController with this code.)

To:

let musicPlayerController: MPMusicPlayerController = MPMusicPlayerController.systemMusicPlayer

(musicPlayerController is explicitly annotated as MPMusicPlayerController.)


In my opinion this is a bug of Swift related to SE-0156 Class and Subtype existentials and you should better send a bug report to Apple or swift.org.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!