One Logo Pool Ball
MusicKit · IOS API REFERENCE

MusicPlayer.Queue

class · iOS 15.0+ · SDK 27.1

class Queue

A representation of the playback queue for a music player.

Members (10)

get · iOS 15.0+

currentEntry

TypeScript
get currentEntry(): (MusicPlayer_Queue_Entry) | null
Swift declaration
var currentEntry: MusicPlayer.Queue.Entry? { get set }

The currently active entry in the playback queue.

set · iOS 15.0+

currentEntry

TypeScript
set currentEntry(value: (MusicPlayer_Queue_Entry) | null)
Swift declaration
var currentEntry: MusicPlayer.Queue.Entry? { get set }

The currently active entry in the playback queue.

get · iOS 15.0+

objectWillChange

TypeScript
get objectWillChange(): _Combine_AnyPublisher<void, never>
Swift declaration
var objectWillChange: AnyPublisher<Void, Never> { get }

A publisher that emits before the object has changed.

get · iOS 26.4+

affectsListeningHistory

TypeScript
get affectsListeningHistory(): boolean
Swift declaration
var affectsListeningHistory: Bool { get set }

A Boolean value that indicates whether this playing this queue will affect the user’s listening history. Defaults to `true`. If `false`, or the user has Settings > Music > Use Listening History set to off, this queue will not show up in the Music app’s Recently Played.

set · iOS 26.4+

affectsListeningHistory

TypeScript
set affectsListeningHistory(value: boolean)
Swift declaration
var affectsListeningHistory: Bool { get set }

A Boolean value that indicates whether this playing this queue will affect the user’s listening history. Defaults to `true`. If `false`, or the user has Settings > Music > Use Listening History set to off, this queue will not show up in the Music app’s Recently Played.

init · iOS 16.4+

init

TypeScript
static initAlbumStartingAt(album: Album, startTrack: Track): MusicPlayer_Queue
Swift declaration
required init(album: Album, startingAt startTrack: Track)

Creates a playback queue with an album and a specific track for the player to start playback.

method · iOS 15.0+

insert

TypeScript
insertPosition(entry: MusicPlayer_Queue_Entry, position: MusicPlayer_Queue_EntryInsertionPosition): Promise<void>
Swift declaration
func insert(_ entry: MusicPlayer.Queue.Entry, position: MusicPlayer.Queue.EntryInsertionPosition) async throws

Inserts an entry into the playback queue.

method · iOS 15.0+

insert

TypeScript
insertPosition19337(entries: Array<MusicPlayer_Queue_Entry>, position: MusicPlayer_Queue_EntryInsertionPosition): Promise<void>
Swift declaration
func insert<S>(_ entries: S, position: MusicPlayer.Queue.EntryInsertionPosition) async throws where S : Sequence, S.Element == MusicPlayer.Queue.Entry

Inserts entries into the playback queue.

init · iOS 16.4+

init

TypeScript
static initPlaylistStartingAt(playlist: Playlist, startPlaylistEntry: Playlist_Entry): MusicPlayer_Queue
Swift declaration
required init(playlist: Playlist, startingAt startPlaylistEntry: Playlist.Entry)

Creates a playback queue with a playlist and a specific playlist entry for the player to start playback.

init · iOS 15.0+

init

TypeScript
static initStartingAt(entries: Array<MusicPlayer_Queue_Entry>, startEntry?: (MusicPlayer_Queue_Entry) | null): MusicPlayer_Queue
Swift declaration
required init<S>(_ entries: S, startingAt startEntry: S.Element? = nil) where S : Sequence, S.Element == MusicPlayer.Queue.Entry

Creates a playback queue with playback queue entries.

Skipped declarations

4 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

MusicPlayer.Queue.init(for:startingAt:)

This declaration needs Swift generic type arguments. (no canonical witness for S)

MusicPlayer.Queue.insert(_:position:)

This declaration needs Swift generic type arguments. (no canonical witness for S)

MusicPlayer.Queue.insert(_:position:)

This declaration needs Swift generic type arguments. (no canonical witness for PlayableMusicItemType)

MusicPlayer.Queue.init(arrayLiteral:)

A variable number of Swift arguments is not supported.

All MusicKit types →