Last active
May 14, 2018 01:30
-
-
Save randyzhao/c0313a63d07d9fd4565cad9e4777d213 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let decoder = JSONDecoder() | |
| let user = try! decoder.decode(User.self, from: json) | |
| let encoder = JSONEncoder() | |
| let jsonData = try! encoder.encode(user) | |
| print(String(data: jsonData, encoding: .utf8)!) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment