Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
標準の音楽アプリと同じように、音楽アプリケーションを作成しています。現在、UISlider を使用して曲の経過時間を読み取って変更する方法に困惑しています。曲の経過時間を読み取って変更するにはどうすればよいですか?
を呼び出しbeginGeneratingPlaybackNotificationsて通知MPMusicPlayerControllerを登録することによりMPMusicPlayerControllerPlaybackStateDidChangeNotification、再生状態が変更されたときに定期的に更新を受け取ります。その通知のハンドラーで、currentPlaybackTimeからを取得できますMPMusicPlayerController。
beginGeneratingPlaybackNotifications
MPMusicPlayerController
MPMusicPlayerControllerPlaybackStateDidChangeNotification
currentPlaybackTime