Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to read results with fetcher #10

Open
alexyak opened this issue Jan 17, 2020 · 0 comments
Open

How to read results with fetcher #10

alexyak opened this issue Jan 17, 2020 · 0 comments

Comments

@alexyak
Copy link

alexyak commented Jan 17, 2020

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()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant