blob: 85b29299b197b1e042259fb2dfe0f64e6fe1f629 (
plain) (
blame)
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
|
//
// ForayDetailViewController.swift
// foray
//
// Created by Nicholas Tay on 16/3/2022.
//
import UIKit
class ForayDetailViewController: UIViewController, HasCustomView, ForayCoordinated {
typealias CustomView = ForayDetailView
var coordinator: ForayCoordinator?
override func viewDidLoad() {
super.viewDidLoad()
self.title = "Details"
}
override func loadView() {
view = ForayDetailView()
}
public func setDetails(item: PenguinItemViewModel) {
let image: UIImage
var description: String = "Type: "
switch item.type {
case .item:
description += "Item"
image = UIImage(named: item.id)!
case .quest:
description += "Quest"
image = UIImage(named: "spy")!
}
description += "\nID: " + item.id
description += "\nReleased: " + item.releaseDateFormatted
self.customView.setDetails(name: item.name, description: description, image: image)
}
}
|