comparison Simoleon/Models/CurrencyQuoteModel.swift @ 11:a62e5e4a4f02

Implementing networking
author Dennis Concepción Martín <dennisconcepcionmartin@gmail.com>
date Tue, 13 Jul 2021 12:14:42 +0100
parents e0c2bda6c51f
children aec2e86e5dbd
comparison
equal deleted inserted replaced
10:ed35ef4738b9 11:a62e5e4a4f02
5 // Created by Dennis Concepción Martín on 11/07/2021. 5 // Created by Dennis Concepción Martín on 11/07/2021.
6 // 6 //
7 7
8 import SwiftUI 8 import SwiftUI
9 9
10 struct CurrencyQuoteModel: Codable { 10 struct CurrencyQuoteModel: Codable, Hashable {
11 var symbol: String 11 var id: UUID?
12 var price: Float 12 var symbol: String?
13 var bid: Float 13 var price: Float?
14 var ask: Float 14 var bid: Float?
15 var timeStamp: Int 15 var ask: Float?
16 var timeStamp: Int?
16 17
17 private enum CodingKeys: String, CodingKey { 18 private enum CodingKeys: String, CodingKey {
18 case symbol = "s" 19 case symbol = "s"
19 case price = "p" 20 case price = "p"
20 case bid = "b" 21 case bid = "b"
21 case ask = "a" 22 case ask = "a"
22 case timeStamp = "t" 23 case timeStamp = "t"
23 } 24 }
24 } 25 }
26 extension CurrencyQuoteModel: Identifiable {}