Xcode 9 beta 3 で、Apple が提供する Music Kit サンプル アプリの「Apple Music にコンテンツを追加する」をビルドしようとしています。しかし、次のような 4 つのエラーが発生しています。 「'pause()' のあいまいな使用」
すでにこの問題を解決している場合、これを修正する方法を教えてください。
func beginPlayback(itemCollection: MPMediaItemCollection) {
musicPlayerController.setQueue(with: itemCollection)
//Ambiguous use of 'play()’
musicPlayerController.play()
}
func beginPlayback(itemID: String) {
musicPlayerController.setQueue(with: [itemID])
//Ambiguous use of 'play()’
musicPlayerController.play()
}
// MARK: Playback Control Methods
func togglePlayPause() {
if musicPlayerController.playbackState == .playing {
//Ambiguous use of 'pause()’
musicPlayerController.pause()
} else {
//Ambiguous use of 'play()’
musicPlayerController.play()
}
}