---
title: "Music Picker | Explore SwiftUI"
description: "Presents a music picker to select items from the Apple Music catalog and the user’s music library"
canonical_url: "https://exploreswiftui.com/library/view/music-picker"
meta:
  author: "Explore SwiftUI"
  "og:description": "Presents a music picker to select items from the Apple Music catalog and the user’s music library"
  "og:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Music%2BPicker%2Cdescription_~UHJlc2VudHMgYSBtdXNpYyBwaWNrZXIgdG8gc2VsZWN0IGl0ZW1zIGZyb20gdGhlIEFwcGxlIE11c2ljIGNhdGFsb2cgYW5kIHRoZSB1c2Vy4oCZcyBtdXNpYyBsaWJyYXJ5Lg%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjMyL3ZhcmlhbnRzLzcyNz92PTE3OTAwNzM0Nzg4NDImcj0yJnc9MTI4MCZxPTg1JmY9anBlZw%2CimageMode_crop%2CimagePosition_top%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm90dG9tOiAwOyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLXRvcC1sZWZ0LXJhZGl1czogNzRweDs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L3ZpZXcvbXVzaWMtcGlja2VyIg%2Cs_qHKobQT7c6ZpiZVi.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Music Picker | Explore SwiftUI"
  "twitter:description": "Presents a music picker to select items from the Apple Music catalog and the user’s music library"
  "twitter:image": "https://exploreswiftui.com/_og/d/c_Component%2Ctitle_Music%2BPicker%2Cdescription_~UHJlc2VudHMgYSBtdXNpYyBwaWNrZXIgdG8gc2VsZWN0IGl0ZW1zIGZyb20gdGhlIEFwcGxlIE11c2ljIGNhdGFsb2cgYW5kIHRoZSB1c2Vy4oCZcyBtdXNpYyBsaWJyYXJ5Lg%2Ccategory_View%2Cimage_~L2FwaS9pbWFnZXMvMjMyL3ZhcmlhbnRzLzcyNz92PTE3OTAwNzM0Nzg4NDImcj0yJnc9MTI4MCZxPTg1JmY9anBlZw%2CimageMode_crop%2CimagePosition_top%2CimageFrame_~cG9zaXRpb246IGFic29sdXRlOyByaWdodDogMDsgd2lkdGg6IDY0MHB4OyBoZWlnaHQ6IDQ4MHB4OyBkaXNwbGF5OiBmbGV4OyBvdmVyZmxvdzogaGlkZGVuOyBiYWNrZ3JvdW5kOiAjRkZGRkZGOyBib3gtc2hhZG93OiAwIC0xMHB4IDUwcHggcmdiYSgzNyw5OSwyMzUsMC4xOCk7IGJvcmRlci1sZWZ0OiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm90dG9tOiAwOyBib3JkZXItdG9wOiAxcHggc29saWQgcmdiYSgwLDAsMCwwLjA2KTsgYm9yZGVyLXRvcC1sZWZ0LXJhZGl1czogNzRweDs%2Cprops_eyJwbGF0Zm9ybXMiOlsiaU9TIiwiaVBhZE9TIiwidmlzaW9uT1MiXX0%2Cp_Ii9saWJyYXJ5L3ZpZXcvbXVzaWMtcGlja2VyIg%2Cs_qHKobQT7c6ZpiZVi.png"
  "twitter:title": "Music Picker | Explore SwiftUI"
---

> Index of every page on this site: [llms.txt](https://exploreswiftui.com/llms.txt)

**Interactive previews**[ iPhone](https://exploreswiftui.com/iphone?element=232)

# **Music Picker**

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

![Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/232/variants/727?v=1790073478842&r=2&w=800&q=80&f=webp)

### **Platform Compatibility**

iOS 27.0+ iPadOS 27.0+ visionOS 27.0+

### **Tags**

### **SwiftUI Code**

[ Docs](<https://developer.apple.com/documentation/swiftui/view/musicpicker(ispresented:title:selection:)>)

```
import MusicKit

@State var showMusicPicker = true
@State var selectedSongs: MusicItemCollection<Song> = []

var body: some View {
    Text("Foo")
        .musicPicker(
            isPresented: $showMusicPicker,
            title: Text("Bar"),
            selection: $selectedSongs
        )
    }
```

### **Found an issue or have a suggestion?**

Created: August 23, 2026Updated: August 23, 2026

### **More View Components **

[**View all **](https://exploreswiftui.com/library/view)

![Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/262/variants/2227?v=1794899667529&r=2&w=412&q=75&f=webp)

### **Scroll Gesture Axis Lock**

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

![VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/260/variants/2143?v=1793707679045&r=2&w=412&q=75&f=webp)

### **VisionOS background materials**

All background materials on visionOS

![Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/257/variants/1987?v=1792070676534&r=2&w=412&q=75&f=webp)

### **Container Content Margins**

Adds the margins of the container the view is in.

![Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/254/variants/1863?v=1790589836833&r=2&w=412&q=75&f=webp)

### **Toolbar Vertical Edge**

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

![Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/249/variants/1765?v=1793099575627&r=2&w=412&q=75&f=webp)

### **Hinge State**

A type encapsulating the state of a single hinge.

![Disabled Toolbar Vertical Behavior - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/246/variants/1636?v=1790277107518&r=2&w=412&q=75&f=webp)

### **Disabled Toolbar Vertical Behavior**

Disables the vertical bar.

![App Store Overlay - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/224/variants/269?v=1790073478842&r=2&w=412&q=75&f=webp)

### **App Store Overlay**

Presents a StoreKit overlay when a given condition is true.

![Manage Subscriptions Sheet - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/223/variants/241?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Manage Subscriptions Sheet**

Opens the manage subscriptions sheet.

### **Explore Other Components **

[**Browse all **](https://exploreswiftui.com/)

![On Primary Photos Picker Action - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/267/variants/2251?v=1794910789851&r=2&w=412&q=75&f=webp)

### **On Primary Photos Picker Action**

Sets the primary action handler for the Photos picker.

![Prioritize Sheet Content Scrolling - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/141/variants/466?v=1795201620589&r=2&w=412&q=75&f=webp)

### **Prioritize Sheet Content Scrolling**

Configures the behavior of swipe gestures on a presentation. PresentationContentInteraction.scrolls prioritizes scrolling the content over resizing the sheet.

![VerticalPageTabViewStyle - watchOS - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/162/variants/463?v=1790073478842&r=2&w=412&q=75&f=webp)

### **VerticalPageTabViewStyle**

A TabViewStyle that displays a vertical TabView interaction and appearance.

![UIKit Content Background colors - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/13/variants/53?v=1790073478842&r=2&w=412&q=75&f=webp)

### **UIKit Content Background colors**

The UIKit colors that are also used in other components like in List and GroupBox

![Color Variants - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview](https://exploreswiftui.com/api/images/9/variants/209?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Color Variants**

HierarchicalShapeStyle, a shape style that maps to one of the numbered content styles

![Tab View Side Bar Bottom Bar - iPadOS - Landscape - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/169/variants/707?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Tab View Side Bar Bottom Bar**

Adds a custom bottom bar to the sidebar of a tab view.

![Search Tab Role - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/163/variants/663?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Search Tab Role**

On Liquid Glass, this tab is placed in its own group. In left-to-right (LTR) layouts, it will always appear on the right side of the TabView.

![Link - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview](https://exploreswiftui.com/api/images/73/variants/207?v=1790073478842&r=2&w=412&q=75&f=webp)

### **Link**

A control for navigating to a URL

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://exploreswiftui.com/#website","@type":"WebSite","description":"A visual library for SwiftUI APIs, components, and modifiers","inLanguage":"en-US","name":"Explore SwiftUI","url":"https://exploreswiftui.com/","publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/music-picker#webpage","@type":"WebPage","dateModified":"2026-08-23T12:43:28.862Z","datePublished":"2026-08-23T12:42:02.241Z","description":"Presents a music picker to select items from the Apple Music catalog and the user’s music library","name":"Music Picker","url":"https://exploreswiftui.com/library/view/music-picker","breadcrumb":{"@id":"https://exploreswiftui.com/library/view/music-picker#breadcrumb"},"isPartOf":{"@id":"https://exploreswiftui.com/#website"},"mainEntity":{"@id":"https://exploreswiftui.com/library/view/music-picker#article"},"potentialAction":[{"@type":"ReadAction","target":["https://exploreswiftui.com/library/view/music-picker"]}],"primaryImageOfPage":{"@id":"https://exploreswiftui.com/#logo"}},{"@id":"https://exploreswiftui.com/#identity","@type":"Organization","description":"A visual library for SwiftUI APIs, components, and modifiers","name":"Explore SwiftUI","url":"https://exploreswiftui.com","logo":{"@id":"https://exploreswiftui.com/#logo"},"sameAs":["https://x.com/Typ0genius","https://mastodon.social/@Typ0genius"]},{"@id":"https://exploreswiftui.com/library/view/music-picker#article","citation":"https://developer.apple.com/documentation/swiftui/view/musicpicker(ispresented:title:selection:)","dateModified":"2026-08-23T12:43:28.862Z","datePublished":"2026-08-23T12:42:02.241Z","description":"Presents a music picker to select items from the Apple Music catalog and the user’s music library","headline":"Music Picker","inLanguage":"en-US","name":"Music Picker","thumbnailUrl":"https://exploreswiftui.com/api/images/232/variants/727?v=1790073478842&r=2","url":"https://exploreswiftui.com/library/view/music-picker","@type":["Article","TechArticle"],"about":{"@type":"Thing","name":"SwiftUI"},"author":{"@id":"https://exploreswiftui.com/#identity"},"hasPart":{"@id":"https://exploreswiftui.com/library/view/music-picker#source-code"},"image":{"@id":"https://exploreswiftui.com/#/schema/image/1"},"isPartOf":{"@id":"https://exploreswiftui.com/library/view/music-picker#webpage"},"mainEntityOfPage":{"@id":"https://exploreswiftui.com/library/view/music-picker#webpage"},"publisher":{"@id":"https://exploreswiftui.com/#identity"}},{"@id":"https://exploreswiftui.com/library/view/music-picker#source-code","@type":"SoftwareSourceCode","codeSampleType":"full example","description":"Presents a music picker to select items from the Apple Music catalog and the user’s music library","name":"Music Picker SwiftUI Example","programmingLanguage":"Swift","runtimePlatform":"SwiftUI","text":"import MusicKit\n\n@State var showMusicPicker = true\n@State var selectedSongs: MusicItemCollection\u003CSong> = []\n\nvar body: some View {\n    Text(\"Foo\")\n        .musicPicker(\n            isPresented: $showMusicPicker,\n            title: Text(\"Bar\"),\n            selection: $selectedSongs\n        )\n    }","about":[{"@type":"Thing","name":"SwiftUI"},{"@type":"Thing","name":"View"},{"@type":"Thing","name":"Music Picker"}]},{"@id":"https://exploreswiftui.com/library/view/music-picker#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://exploreswiftui.com","position":1},{"@type":"ListItem","name":"View","item":"https://exploreswiftui.com/library/view","position":2},{"@type":"ListItem","name":"Music Picker","item":"https://exploreswiftui.com/library/view/music-picker","position":3}]},{"@id":"https://exploreswiftui.com/#logo","@type":"ImageObject","caption":"Explore SwiftUI","contentUrl":"https://exploreswiftui.com/apple-touch-icon.png","inLanguage":"en","url":"https://exploreswiftui.com/apple-touch-icon.png"},{"@id":"https://exploreswiftui.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://exploreswiftui.com/api/images/232/variants/727?v=1790073478842&r=2","inLanguage":"en","url":"https://exploreswiftui.com/api/images/232/variants/727?v=1790073478842&r=2"}]}
```