I am developing and IOS app to integrate MusicKit
to get User songs from their Music Library.
Since I am new to Swift and Native IOS development, it is quite difficult for me to understand the Apple Documentation.
I have able to get users Album, Songs, from library but It's properties are limited to
Song(id: "i.GEGNo8Xh0EMr8Ov", title: "Walk On Water (feat. Beyoncé)", artistName: "Eminem")
I need to get other properties of songs such as ISRC, genre, duration etc. What can I do to get the other properties? Below mentioned is my Swift Code for User Music.
I'm following this docs from Apple.
if #available(iOS 15.0, *) {
let status = await MusicAuthorization.request()
switch status {
case .authorized:
do {
let playlistRequest = MusicLibraryRequest<Song>()
var playlistResponse = try await playlistRequest.response().items[1]
print(playlistResponse)
print(playlistResponse.artistName)
} catch {
/* handle error */
}
}