Instance Property

indexOfNowPlayingItem

The index of the now playing item in the current playback queue.

Declaration

var indexOfNowPlayingItem: Int { get }

Discussion

This property’s value is NSNotFound if the index is not valid—for example, if the playback queue is empty.

See Also

Managing Playback Mode and State

var nowPlayingItem: MPMediaItem?

The currently-playing media item, or the media item, within a queue, that you have designated to begin playback with.

var playbackState: MPMusicPlaybackState

The current playback state of the music player.

var repeatMode: MPMusicRepeatMode

The current repeat mode of the music player.

var shuffleMode: MPMusicShuffleMode

The current shuffle mode of the music player.

enum MPMusicPlaybackState

The music player playback state modes.

enum MPMusicRepeatMode

The repeat modes for the media player.

enum MPMusicShuffleMode

The shuffle modes for the media player.