← ClaudeAtlas

musickitlisted

Integrate Apple Music playback, catalog search, and Now Playing metadata using MusicKit and MediaPlayer. Use when adding music search, Apple Music subscription flows, queue management, playback controls, remote command handling, or Now Playing info to iOS apps.
dpearson2699/swift-ios-skills · ★ 730 · AI & Automation · score 80
Install: claude install-skill dpearson2699/swift-ios-skills
# MusicKit Search the Apple Music catalog, manage playback with `ApplicationMusicPlayer`, check subscriptions, and publish Now Playing metadata via `MPNowPlayingInfoCenter` and `MPRemoteCommandCenter`. Targets Swift 6.3 / iOS 26+. ## Contents - [Setup](#setup) - [Authorization](#authorization) - [Catalog Search](#catalog-search) - [Subscription Checks](#subscription-checks) - [Playback with ApplicationMusicPlayer](#playback-with-applicationmusicplayer) - [Queue Management](#queue-management) - [Now Playing Info](#now-playing-info) - [Remote Command Center](#remote-command-center) - [Common Mistakes](#common-mistakes) - [Review Checklist](#review-checklist) - [References](#references) ## Setup ### Project Configuration 1. Enable the **MusicKit** capability in Xcode (adds the `com.apple.developer.musickit` entitlement) 2. Add `NSAppleMusicUsageDescription` to Info.plist explaining why the app accesses Apple Music 3. For background playback, add the `audio` background mode to `UIBackgroundModes` ### Imports ```swift import MusicKit // Catalog, auth, playback import MediaPlayer // MPRemoteCommandCenter, MPNowPlayingInfoCenter ``` ## Authorization Request permission before accessing the user's music data or playing Apple Music content. Authorization is a one-time prompt per app install. ```swift func requestMusicAccess() async -> MusicAuthorization.Status { let status = await MusicAuthorization.request() switch status { case .authorized: //