Skip to content
This repository was archived by the owner on Jan 4, 2023. It is now read-only.

Commit c76879a

Browse files
committed
Merge branch 'master' into apple-silicon-compatibility
2 parents f77b605 + 1607674 commit c76879a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Kiosk/App/Models/Artwork.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,12 @@ import SwiftyJSON
9494
private func titleAndDateAttributedString(_ title: String, dateString: String) -> NSAttributedString {
9595
let workTitle = title.isEmpty ? "Untitled" : title
9696

97-
let workFont = UIFont.serifItalicFont(withSize: 16)!
98-
let attributedString = NSMutableAttributedString(string: workTitle, attributes: [NSAttributedStringKey.font : workFont])
97+
let workFont: UIFont? = UIFont.serifItalicFont(withSize: 16)
98+
let attributedString = NSMutableAttributedString(string: workTitle, attributes: workFont == nil ? nil : [NSAttributedStringKey.font : workFont!])
9999

100100
if dateString.isNotEmpty {
101-
let dateFont = UIFont.serifFont(withSize: 16)!
102-
let dateString = NSAttributedString(string: ", " + dateString, attributes: [NSAttributedStringKey.font : dateFont])
101+
let dateFont: UIFont? = UIFont.serifFont(withSize: 16)
102+
let dateString = NSAttributedString(string: ", " + dateString, attributes: dateFont == nil ? nil : [NSAttributedStringKey.font : dateFont!])
103103
attributedString.append(dateString)
104104
}
105105

0 commit comments

Comments
 (0)