Created
May 13, 2018 23:06
-
-
Save randyzhao/3acfbb8191faeeaa5450a519f978a124 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
| struct Country: Codable { | |
| let countryName: String | |
| let countryCode: String | |
| private enum CodingKeys: String, CodingKey { | |
| case countryName = "name" | |
| case countryCode = "code" | |
| } | |
| } | |
| enum UserType: Int, Codable { | |
| case normal = 1 | |
| case admin = 2 | |
| } | |
| struct User: Codable { | |
| let username: String | |
| let type: UserType | |
| let country: Country | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment