---
title: "init(apiVersion:options:)"
framework: ituneslibrary
role: symbol
role_heading: Initializer
path: "ituneslibrary/itlibrary/init(apiversion:options:)-9eorg"
---

# init(apiVersion:options:)

Initializes an instance of ITLibrary that can retrieve media entities.

## Declaration

```swift
init(apiVersion requestedAPIVersion: String, options: ITLibInitOptions) throws
```

## Parameters

- `requestedAPIVersion`: The version of the iTunesLibrary API that the app is requesting. Provide "1.0" if unknown.
- `options`: Options that change the initialization behavior. See doc://com.apple.ituneslibrary/documentation/iTunesLibrary/ITLibInitOptions.

## Return Value

Return Value An ITLibrary instance that can retrieve media entities, or nil if the method fails.

## Discussion

Discussion Unless you specify the ITLibInitOptions.lazyLoadData option, the system reads and parses the default iTunes database for the current user during initialization of the ITLibrary class. All media entities cache in memory until deallocation of the object occurs.

## See Also

### Essentials

- [init(apiVersion:)](ituneslibrary/itlibrary/init(apiversion:)-71e74.md)
- [ITLibInitOptions](ituneslibrary/itlibinitoptions.md)
