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
import UIKit | |
struct Country: Codable { | |
let name: String | |
let capital: String | |
let callingCodes: [String] | |
let population: Double | |
let area: Double | |
let borders: [String] | |
let region: String |
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
import UIKit | |
struct Country: Codable { | |
let name: String | |
let capital: String | |
let alternateSpellings: [String] | |
enum CodingKeys: String, CodingKey { | |
case name | |
case capital |
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
import UIKit | |
struct Country: Codable { | |
let name: String | |
let capital: String | |
let callingCodes: [String] | |
} | |
let jsonData: Data = """ | |
{ |
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
import UIKit | |
struct Country: Codable { | |
let name: String | |
let capital: String | |
let independanceDay: Date | |
} | |
let jsonData: Data = """ | |
{ |
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
import UIKit | |
struct Country: Codable { | |
let name: String | |
let capital: String | |
} | |
let jsonData: Data = """ | |
{ | |
"name": "United States of America", |
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
import UIKit | |
struct Country: Codable { | |
let name: String | |
let capital: String | |
let alternateSpellings: [String] | |
enum CodingKeys: String, CodingKey { | |
case name | |
case capital |
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
import UIKit | |
struct Employee: Codable { | |
let name: String | |
let phoneNumber: String? | |
} | |
let jsonDataWithPhoneNumber: Data = """ | |
{ | |
"name": "Eric", |
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
import UIKit | |
struct Employee: Decodable { | |
let name: String | |
let city: String | |
enum CodingKeys: String, CodingKey { | |
case name | |
case city | |
case contactInformation |
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
import Foundation | |
struct Country: Codable, Equatable, CountryListItemRepresentable, CountryDetailRepresentable { | |
let name: String | |
let capital: String | |
let region: String | |
let subregion: String | |
let timezones: [String] | |
let borders: [String] |
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
import Foundation | |
private struct CountryListEndpoint: EndpointReprsentable { | |
var httpMethod: HTTPMethod { .get } | |
var urlPath: URLPath { .name } | |
let pathComponent: String? | |
} |
OlderNewer