aboutsummaryrefslogtreecommitdiff
path: root/foray/Scenes
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-03-25 09:25:35 +1100
committerNicholas Tay <nick@windblume.net>2022-03-25 09:25:35 +1100
commitfe60f99848498a932d9113f8e516700a836dd1cd (patch)
tree282b8a7f420754f81e1e2c5fed381221b34a9846 /foray/Scenes
parentd8624dbf8a9111f931802cbb2759ebd009096552 (diff)
downloadforayios-fe60f99848498a932d9113f8e516700a836dd1cd.tar.gz
forayios-fe60f99848498a932d9113f8e516700a836dd1cd.tar.bz2
forayios-fe60f99848498a932d9113f8e516700a836dd1cd.zip
Move Details ViewModel -> string/image into VC
Diffstat (limited to 'foray/Scenes')
-rw-r--r--foray/Scenes/ForayDetailViewController.swift17
1 files changed, 15 insertions, 2 deletions
diff --git a/foray/Scenes/ForayDetailViewController.swift b/foray/Scenes/ForayDetailViewController.swift
index c676df6..85b2929 100644
--- a/foray/Scenes/ForayDetailViewController.swift
+++ b/foray/Scenes/ForayDetailViewController.swift
@@ -22,8 +22,21 @@ class ForayDetailViewController: UIViewController, HasCustomView, ForayCoordinat
view = ForayDetailView()
}
- public func setDetails(name: String, description: String, image: UIImage) {
- self.customView.setDetails(name: name, description: description, image: image)
+ 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)
}
}