iPhone SwiftUI layouts
Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.
201elements
View
Music Picker
Presents a music picker to select items from the Apple Music catalog and the user’s music library.
Explore Music Picker on iPhone in portrait, with SwiftUI code and Apple API documentation.
SwiftUI code
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
)
}Compatibility
iOS 27.0+ iPadOS 27.0+ visionOS 27.0+
Tags
Found an issue or have a suggestion?
All variants
Every available iPhone screenshot for Music Picker.