Guest User

Untitled

a guest
Dec 17th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. game["id", "user":["id"]]
  2.  
  3. game.id and game.user.id
  4.  
  5. import ObjectMapper
  6.  
  7. class GamesData: Mappable {
  8.  
  9. var id: String? = ""
  10. var user = [UsersData]()
  11.  
  12. convenience required init?(map: Map) {
  13. self.init(map: map)
  14. }
  15.  
  16. func mapping(map: Map) {
  17.  
  18. id <- map["id"]
  19. user <- map["user"]
  20. }
  21. }
  22.  
  23. import ObjectMapper
  24.  
  25. class UsersData: Mappable {
  26.  
  27. var id: String? = ""
  28.  
  29. convenience required init?(map: Map) {
  30. self.init(map: map)
  31. }
  32.  
  33. func mapping(map: Map) {
  34.  
  35. id <- map["id"]
  36. }
  37. }
Add Comment
Please, Sign In to add comment