Created
November 17, 2017 07:30
-
-
Save shiningabdul/8d6cd27786e0f566ce1fe083a7a16dd5 to your computer and use it in GitHub Desktop.
This file contains 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
class User : Transmittable { | |
var id:String? | |
} | |
// Turning a user into JSON data | |
let user = User() | |
user.id = "123" | |
let data = user.encode() | |
// Turning JSON data back into a user | |
let serverResponse = User.decode(from: data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment