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