Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extension User {
- func toJSON() -> [String : Any] {
- var json = [String : Any]()
- json["firstName"] = firstName
- json["lastName"] = lastName
- json["age"] = age
- json["friends"] = friends.map { $0.toJSON() }
- json["coworkers"] = coworkers.map { $0.toJSON() }
- json["favorites"] = favorites.map { $0.toJSON() }
- json["messages"] = messages.map { $0.toJSON() }
- json["notes"] = notes.map { $0.toJSON() }
- json["tasks"] = tasks.map { $0.toJSON() }
- json["imageURLs"] = imageURLs.map { $0.absoluteString }
- json["groups"] = groups.map { $0.toJSON() }
- return json
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement