One Logo Pool Ball
MusicKit · IOS API REFERENCE

Album

struct · iOS 15.0+ · SDK 27.1

struct Album

A music item that represents an album.

Members (32)

get · iOS 15.0+

artistName

TypeScript
get artistName(): string
Swift declaration
var artistName: String { get }

The artist’s name. You can find more precise information about this album’s artists in the ``artists`` relationship, which, unlike ``artistName``, requires that you load it explicitly using the ``MusicPropertyContainer/with(_:)`` method, as in the following example: ```swift let detailedAlbum = try await album.with([.artists]) let firstArtist = album.artists?.first ```

get · iOS 15.0+

genreNames

TypeScript
get genreNames(): Array<string>
Swift declaration
var genreNames: [String] { get }

The names of the album’s associated genres.

get · iOS 15.0+

isComplete

TypeScript
get isComplete(): (boolean) | null
Swift declaration
var isComplete: Bool? { get }

A Boolean value that indicates whether the album is complete. If true, the album is complete; otherwise, it’s incomplete. An album is complete if it contains all its tracks and songs.

get · iOS 15.0+

trackCount

TypeScript
get trackCount(): number
Swift declaration
var trackCount: Int { get }

The number of tracks for the album.

get · iOS 15.0+

description

TypeScript
get description(): string
Swift declaration
var description: String { get }

A textual representation of this instance. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(describing:)` initializer. This initializer works with any type, and uses the custom `description` property for types that conform to `CustomStringConvertible`: struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `description` property.

get · iOS 15.0+

releaseDate

TypeScript
get releaseDate(): (globalThis.Date) | null
Swift declaration
var releaseDate: Date? { get }

The release date (or expected prerelease date) for the album.

get · iOS 15.0+

recordLabels

TypeScript
get recordLabels(): (MusicItemCollection<RecordLabel>) | null
Swift declaration
var recordLabels: MusicItemCollection<RecordLabel>? { get }

The record labels for the album.

get · iOS 16.0+

audioVariants

TypeScript
get audioVariants(): (Array<AudioVariant>) | null
Swift declaration
var audioVariants: [AudioVariant]? { get }

The variants that indicate the quality of audio available for the album.

get · iOS 15.0+

contentRating

TypeScript
get contentRating(): (ContentRating) | null
Swift declaration
var contentRating: ContentRating? { get }

The rating of the content. A nil value means no rating is available for this album.

get · iOS 15.0+

isCompilation

TypeScript
get isCompilation(): (boolean) | null
Swift declaration
var isCompilation: Bool? { get }

A Boolean value that indicates whether the album is a compilation.

get · iOS 15.0+

otherVersions

TypeScript
get otherVersions(): (MusicItemCollection<Album>) | null
Swift declaration
var otherVersions: MusicItemCollection<Album>? { get }

A collection of other versions of the album.

get · iOS 15.0+

relatedAlbums

TypeScript
get relatedAlbums(): (MusicItemCollection<Album>) | null
Swift declaration
var relatedAlbums: MusicItemCollection<Album>? { get }

A collection of related albums.

get · iOS 15.0+

relatedVideos

TypeScript
get relatedVideos(): (MusicItemCollection<MusicVideo>) | null
Swift declaration
var relatedVideos: MusicItemCollection<MusicVideo>? { get }

A collection of the album’s music videos.

get · iOS 15.0+

editorialNotes

TypeScript
get editorialNotes(): (EditorialNotes) | null
Swift declaration
var editorialNotes: EditorialNotes? { get }

The notes about the album that appear in the Music app.

get · iOS 16.0+

lastPlayedDate

TypeScript
get lastPlayedDate(): (globalThis.Date) | null
Swift declaration
var lastPlayedDate: Date? { get }

The date when the user last played the album on this device.

get · iOS 15.0+

playParameters

TypeScript
get playParameters(): (PlayParameters) | null
Swift declaration
var playParameters: PlayParameters? { get }

The parameters to use to play the tracks of the album.

get · iOS 15.0+

recordLabelName

TypeScript
get recordLabelName(): (string) | null
Swift declaration
var recordLabelName: String? { get }

The name of the album’s record label.

get · iOS 15.0+

debugDescription

TypeScript
get debugDescription(): string
Swift declaration
var debugDescription: String { get }

A textual representation of this instance, suitable for debugging. Calling this property directly is discouraged. Instead, convert an instance of any type to a string by using the `String(reflecting:)` initializer. This initializer works with any type, and uses the custom `debugDescription` property for types that conform to `CustomDebugStringConvertible`: struct Point: CustomDebugStringConvertible { let x: Int, y: Int var debugDescription: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(reflecting: p) print(s) // Prints "(21, 30)" The conversion of `p` to a string in the assignment to `s` uses the `Point` type's `debugDescription` property.

get · iOS 16.0+

libraryAddedDate

TypeScript
get libraryAddedDate(): (globalThis.Date) | null
Swift declaration
var libraryAddedDate: Date? { get }

The date when the user added the album to the library.

get · iOS 16.0+

isAppleDigitalMaster

TypeScript
get isAppleDigitalMaster(): (boolean) | null
Swift declaration
var isAppleDigitalMaster: Bool? { get }

A Boolean value that indicates whether the album is an Apple Digital Master. Apple Digital Masters start from 24-bit files and are optimized to bring the best-sounding audio to Apple products.

get · iOS 15.0+

id

TypeScript
get id(): MusicItemID
Swift declaration
let id: MusicItemID

The unique identifier for the album.

get · iOS 15.0+

upc

TypeScript
get upc(): (string) | null
Swift declaration
var upc: String? { get }

The universal product code (UPC) for the album.

get · iOS 15.0+

url

TypeScript
get url(): (string) | null
Swift declaration
var url: URL? { get }

The URL for the album.

get · iOS 15.0+

title

TypeScript
get title(): string
Swift declaration
var title: String { get }

The title of the album.

get · iOS 15.0+

genres

TypeScript
get genres(): (MusicItemCollection<Genre>) | null
Swift declaration
var genres: MusicItemCollection<Genre>? { get }

The genres for the album.

get · iOS 15.0+

tracks

TypeScript
get tracks(): (MusicItemCollection<Track>) | null
Swift declaration
var tracks: MusicItemCollection<Track>? { get }

The tracks on the album.

get · iOS 15.0+

artists

TypeScript
get artists(): (MusicItemCollection<Artist>) | null
Swift declaration
var artists: MusicItemCollection<Artist>? { get }

The album’s associated artists.

get · iOS 15.0+

artwork

TypeScript
get artwork(): (Artwork) | null
Swift declaration
var artwork: Artwork? { get }

The album artwork.

get · iOS 15.0+

isSingle

TypeScript
get isSingle(): (boolean) | null
Swift declaration
var isSingle: Bool? { get }

A Boolean value that indicates whether the album consists of a single song.

get · iOS 15.0+

appearsOn

TypeScript
get appearsOn(): (MusicItemCollection<Playlist>) | null
Swift declaration
var appearsOn: MusicItemCollection<Playlist>? { get }

A collection of playlists that include tracks from the album.

get · iOS 15.0+

artistURL

TypeScript
get artistURL(): (string) | null
Swift declaration
var artistURL: URL? { get }

The artist’s URL.

get · iOS 15.0+

copyright

TypeScript
get copyright(): (string) | null
Swift declaration
var copyright: String? { get }

The copyright text for the album.

Skipped declarations

No declarations were skipped in this snapshot.

All MusicKit types →