AppleMusicKit
AppleMusicKit copied to clipboard
How to read results with fetcher
I can't figure out how to read the results that I get using framework's fetcher. For example:
public func GetMyRecomendations(_ result: @escaping ([MusicItem]) -> Void) { let authorization = Authorization(developerToken: token, musicUserToken: authorizationManager.userToken) let task = build(GetRecentlyPlayed(language: "en"), authorization: authorization, using: fetcher) { response in do { let response = try response let result = try response.get() for item in result.data { let resource = item as AnyResource // How do I get the values for href, id or name here?
}
} catch {
print(error)
}
}
task?.resume()
}