Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. let json = try JSON(data: response)
  2. let movies: [Movie]?
  3.  
  4. switch json {
  5. case let .array(jsonModels):
  6. let moviesDict = try jsonModels.map { try JSON($0.getDictionary(at: "movie")) }
  7. movies = try moviesDict.map(Movie.init)
  8. default:
  9. movies = nil
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement