Created
August 21, 2022 12:36
-
-
Save ashishkakkad8/a7eaa4ea40434640cd2ea2169e9a1858 to your computer and use it in GitHub Desktop.
Models for Contacts JSON Response
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
// | |
// Models.swift | |
// APISwiftUI | |
// | |
// Created by Kode on 04/08/22. | |
// | |
import Foundation | |
// MARK: - ContactResult | |
struct ContactResult: Codable { | |
let contacts: [Contact]? | |
} | |
// MARK: - Contact | |
struct Contact: Codable, Identifiable { | |
let id = UUID() | |
let name, email, address: String? | |
let gender: String? | |
let phone: Phone? | |
} | |
// MARK: - Phone | |
struct Phone: Codable { | |
let mobile, home, office: String? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment