Created
May 21, 2017 03:35
-
-
Save mazz/86abd089b2f7a1c7a01f4669126eb988 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let session = URLSession.shared | |
| let task = session.dataTask(with: request as URLRequest, completionHandler: {(data, response, error) in | |
| if (error == nil) { | |
| do { | |
| let json = try! JSONSerialization.jsonObject(with: data!, options: []) | |
| let books = Mapper<BookResponse>.mapArray(json) // ERROR: Argument labels '(_:)' do not match any available overloads | |
| if let jsonResult = try JSONSerialization.jsonObject(with: data!, options: []) as? NSDictionary { | |
| print(jsonResult) | |
| DispatchQueue.main.async { | |
| success(jsonResult)} | |
| } | |
| } | |
| } | |
| }); | |
| task.resume() |
let books = Mapper<BookResponse>().mapArray(json)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
BookResponse.swift: