TechnologiesAudio

iTunesLibrary

iOSmacOStvOSwatchOSvisionOS

iTunesLibrary provides read-only access to the user's iTunes and Music library on macOS. You begin with an ITLibrary instance and read its contents through model objects such as ITLibMediaItem, ITLibAlbum, ITLibArtist, ITLibArtwork, and ITLibPlaylist, all sharing the common ITLibMediaEntity base. Enumerations including ITLibMediaItemMediaKind, ITLibMediaItemLocationType, ITLibMediaItemPlayStatus, and ITLibPlaylistKind describe the metadata of each entity, while DidChangeLibraryMessage reports when the library changes.

Accessing the Library 4

Open the user's iTunes and Music library and respond to changes in its contents.

  • Cl
    ITLibrary
    @abstract A class representing an iTunes library whose metadata is being queried.
  • En
    ITLibInitOptions
    @enum ITLibInitOptions
  • En
    ITLibExportFeature
    @enum ITLibExportFeature
  • St
    DidChangeLibraryMessagemacOS 26.0+
    A message that reports when the contents of the user's library have changed.

Library Entities 1

The shared base class from which every model object in the library derives.

  • Cl
    ITLibMediaEntity
    @abstract The ITLibMediaEntity class serves as the abstract superclass for ITLibMediaItem and ITLibPlaylist instances.

Media Items 2

Read the metadata of individual songs, videos, and other media in the library.

  • Cl
    ITLibMediaItem
    @abstract A media item represents a single piece of media (such as a song, a video, a podcast, etc) in the iTunes library.
  • Cl
    ITLibMediaItemVideoInfo
    @abstract The ITLibMediaItemVideoInfo class encapsulates the video information of a video media item.

Albums and Artists 2

Inspect the albums and artists that group media items together.

  • Cl
    ITLibAlbum
    @abstract The ITLibAlbum class represents an album where a given media item (ITLibMediaItem) is contained.
  • Cl
    ITLibArtist
    The ITLibArtist class represents an artist, such as the performer of a song.

Artwork 2

Access the cover artwork associated with media items.

  • Cl
    ITLibArtwork
    @abstract The ITLibArtwork class represents a media item artwork.
  • En
    ITLibArtworkFormat
    @enum ITLibArtworkFormat

Playlists 3

Read user and system playlists along with the kinds that classify them.

  • Cl
    ITLibPlaylist
    @abstract A playlist is a collection of related media items. (Media items are described in ITLibMediaItem Class Reference.)
  • En
    ITLibPlaylistKind
    @enum ITLibPlaylistKind
  • En
    ITLibDistinguishedPlaylistKind
    @enum ITLibDistinguishedPlaylistKind

Media Item Attributes 4

Constants that describe the kind, location, play status, and content rating of media items.

  • En
    ITLibMediaItemMediaKind
    @enum ITLibMediaItemMediaKind
  • En
    ITLibMediaItemLocationType
    @enum ITLibMediaItemLocationType
  • En
    ITLibMediaItemPlayStatus
    @enum ITLibMediaItemPlayStatus
  • En
    ITLibMediaItemLyricsContentRating
    @enum ITLibMediaItemLyricsContentRating

Extends 2

NSNotificationNotificationCenter
← Audio