'How can I access the dictionary model?
So I basically have this model;
// MARK: - Welcome
struct Welcome: Codable {
let league: League
}
}
// MARK: - League
struct League: Codable {
let standard: [Sacramento]
}
// MARK: - Sacramento
struct Sacramento: Codable {
let firstName, lastName: String
}
}
But when I try to access the firstName or lastName, I can't and can't find it.
var result: Welcome?
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let text = result?.league.standard. // this is where I can't access...
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
