aboutsummaryrefslogtreecommitdiff
path: root/foray/Scenes/ForayDetailViewController.swift
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-07-17 02:25:12 +1000
committerNicholas Tay <nick@windblume.net>2022-07-17 02:25:12 +1000
commitbd7761216a065b0dd859cb19d709996739a240cd (patch)
tree8b1d33034f8c212613d7a07b864d1688b8c080d2 /foray/Scenes/ForayDetailViewController.swift
parent1adbed9f8b94521befd237c14d36325a55037a41 (diff)
downloadforayios-bd7761216a065b0dd859cb19d709996739a240cd.tar.gz
forayios-bd7761216a065b0dd859cb19d709996739a240cd.tar.bz2
forayios-bd7761216a065b0dd859cb19d709996739a240cd.zip
Clean up force unwraps and lets
Wow, I didn't know `if let` was a thing back then, haha. Also made UIImage a bit safer in case asset is missing by unwrapping in one common place.
Diffstat (limited to 'foray/Scenes/ForayDetailViewController.swift')
-rw-r--r--foray/Scenes/ForayDetailViewController.swift4
1 files changed, 2 insertions, 2 deletions
diff --git a/foray/Scenes/ForayDetailViewController.swift b/foray/Scenes/ForayDetailViewController.swift
index 1e2f9ca..52aa6b8 100644
--- a/foray/Scenes/ForayDetailViewController.swift
+++ b/foray/Scenes/ForayDetailViewController.swift
@@ -29,10 +29,10 @@ class ForayDetailViewController: UIViewController, HasCustomView, Coordinated {
switch item.type {
case .item:
description += "Item"
- image = UIImage(named: item.id)!
+ image = UIImage(named: item.id) ?? UIImage.fromAsset(.it)
case .quest:
description += "Quest"
- image = UIImage(named: "spy")!
+ image = UIImage.fromAsset(.spy)
}
description += "\nID: " + item.id
description += "\nReleased: " + item.releaseDateFormatted