-
Notifications
You must be signed in to change notification settings - Fork 0
/
LeaguesDetailes.swift
51 lines (35 loc) · 1.07 KB
/
LeaguesDetailes.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//
// LeaguesDetailesModel.swift
// SportsApp
//
// Created by Norhan on 4/21/21.
// Copyright © 2021 Norhan. All rights reserved.
//
import Foundation
struct LeaguesDetailesModel: Codable {
let leagues : [LeaguesDetailes]?
enum CodingKeys: String, CodingKey {
case leagues = "leagues"
}
}
struct LeaguesDetailes : Codable {
let strLeague : String?
let strYoutube : String?
let strBadge : String?
enum CodingKeys: String, CodingKey {
case strLeague = "strLeague"
case strYoutube = "strYoutube"
case strBadge = "strBadge"
}
init(from decoder: Decoder) throws {
let values = try decoder.container(keyedBy: CodingKeys.self)
strLeague = try values.decodeIfPresent(String.self, forKey: .strLeague)
strYoutube = try values.decodeIfPresent(String.self, forKey: .strYoutube)
strBadge = try values.decodeIfPresent(String.self, forKey: .strBadge)
}
init(){
strLeague = ""
strYoutube = ""
strBadge = ""
}
}