Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. extension User {
  2. func toJSON() -> [String : Any]
  3. return [
  4. "firstName": firstName,
  5. "lastName": lastName,
  6. "age": age,
  7. "friends": friends.map { $0.toJSON() },
  8. "coworkers": coworkers.map { $0.toJSON() },
  9. "favorites": favorites.map { $0.toJSON() },
  10. "messages": messages.map { $0.toJSON() },
  11. "notes": notes.map { $0.toJSON() },
  12. "tasks": tasks.map { $0.toJSON() },
  13. "imageURLs": imageURLs.map { $0.absoluteString },
  14. "groups": groups.map { $0.toJSON() }
  15. ]
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement