Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let json = try JSON(data: response)
- let movies: [Movie]?
- switch json {
- case let .array(jsonModels):
- let moviesDict = try jsonModels.map { try JSON($0.getDictionary(at: "movie")) }
- movies = try moviesDict.map(Movie.init)
- default:
- movies = nil
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement