<!--
{
  "availability" : [
    "macCatalyst: 14.0.0 -",
    "macOS: 10.13.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "iTunesLibrary",
  "identifier" : "/documentation/iTunesLibrary/ITLibrary",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "iTunes Library"
    ],
    "preciseIdentifier" : "c:objc(cs)ITLibrary"
  },
  "title" : "ITLibrary"
}
-->

# ITLibrary

This class serves as the entry point to the iTunesLibrary framework.

```
class ITLibrary
```

## Overview

Use the [`ITLibrary`](/documentation/iTunesLibrary/ITLibrary) properties and methods to retrieve media items (tracks) and playlists from the user’s iTunes library. [`ITLibrary`](/documentation/iTunesLibrary/ITLibrary) also provides methods for extracting artwork from a media file that may or may not be in the iTunes library. Sandboxed and nonsandboxed apps can also use iTunes’ ability to extract artwork.

> Important: A person needs to grant your app permission before it can access their iTunes library. Add the <doc://com.apple.documentation/documentation/BundleResources/Information-Property-List/NSAppleMusicUsageDescription> key to your app’s `Info.plist` file, and include a description of how you intend to use their library. If this key isn’t present, the system terminates your app when it tries to access the library.

## Topics

### Essentials

[`init(apiVersion:)`](/documentation/iTunesLibrary/ITLibrary/init(apiVersion:)-71e74)

Initializes an instance of [`ITLibrary`](/documentation/iTunesLibrary/ITLibrary) that can retrieve media entities.

[`init(apiVersion:options:)`](/documentation/iTunesLibrary/ITLibrary/init(apiVersion:options:)-9eorg)

Initializes an instance of `ITLibrary` that can retrieve media entities.

[`libraryWithAPIVersion:error:`](/documentation/iTunesLibrary/ITLibrary/libraryWithAPIVersion:error:)

Creates and initializes an instance of `ITLibrary` that can retrieve media entities.

[`libraryWithAPIVersion:options:error:`](/documentation/iTunesLibrary/ITLibrary/libraryWithAPIVersion:options:error:)

Creates and initializes an instance of ITLibrary that can retrieve media entities.

[`ITLibInitOptions`](/documentation/iTunesLibrary/ITLibInitOptions)

These constants describe initialization options for an iTunes library.

### Getting iTunes Library Info

[`allMediaItems`](/documentation/iTunesLibrary/ITLibrary/allMediaItems)

All the media items (tracks) in the iTunes library.

[`allPlaylists`](/documentation/iTunesLibrary/ITLibrary/allPlaylists)

All the playlists in the iTunes library.

[`apiMajorVersion`](/documentation/iTunesLibrary/ITLibrary/apiMajorVersion)

The major version number of the API the iTunesLibrary framework exposes.

[`apiMinorVersion`](/documentation/iTunesLibrary/ITLibrary/apiMinorVersion)

The minor version number of the API the iTunesLibrary framework exposes.

[`applicationVersion`](/documentation/iTunesLibrary/ITLibrary/applicationVersion)

The version of iTunes that created or modified the iTunes library you’re accessing.

[`mediaFolderLocation`](/documentation/iTunesLibrary/ITLibrary/mediaFolderLocation)

The location of the iTunes music folder.

[`shouldShowContentRating`](/documentation/iTunesLibrary/ITLibrary/shouldShowContentRating)

A Boolean value indicating whether to show content rating labels.

### Loading and Unloading Data

[`reloadData()`](/documentation/iTunesLibrary/ITLibrary/reloadData())

Refreshes the data that the framework uses.

[`unloadData()`](/documentation/iTunesLibrary/ITLibrary/unloadData())

Unloads the data that the framework uses.

### Accessing Artwork

[`artwork(forMediaFile:)`](/documentation/iTunesLibrary/ITLibrary/artwork(forMediaFile:))

Retrieves the artwork from a media file that may or may not be in the iTunes library.

### Deprecated

[`features`](/documentation/iTunesLibrary/ITLibrary/features)

A bitwise OR combination of the features of this library.

[`ITLibExportFeature`](/documentation/iTunesLibrary/ITLibExportFeature)

These constants describe the features that an iTunes library supports.

[`musicFolderLocation`](/documentation/iTunesLibrary/ITLibrary/musicFolderLocation)

The location of the iTunes music folder.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)