---
title: "createPlaylist(name:description:authorDisplayName:items:)"
framework: musickit
role: symbol
role_heading: Instance Method
path: "musickit/musiclibrary/createplaylist(name:description:authordisplayname:items:)"
---

# createPlaylist(name:description:authorDisplayName:items:)

Creates a playlist in the user’s music library.

## Declaration

```swift
@discardableResult func createPlaylist<S, MusicPlaylistAddableType>(name: String, description: String? = nil, authorDisplayName: String? = nil, items: S) async throws -> Playlist where S : Sequence, MusicPlaylistAddableType : MusicPlaylistAddable, MusicPlaylistAddableType == S.Element
```

## Parameters

- `name`: The name of the playlist.
- `description`: An optional description of the playlist.
- `authorDisplayName`: The display name of the author for the playlist. A nil value will result in the framework using your app’s name instead.
- `items`: The items of the playlist.

## Return Value

Return Value The newly created playlist.
