diff --git a/VDSSample/ViewControllers/LabelViewController.swift b/VDSSample/ViewControllers/LabelViewController.swift index e5d5fff..a64123e 100644 --- a/VDSSample/ViewControllers/LabelViewController.swift +++ b/VDSSample/ViewControllers/LabelViewController.swift @@ -136,14 +136,18 @@ class LabelViewController: ModelViewController, StoryboardIni didSet { fontCategoryLabel.text = fontCategory.rawValue textSizePicker.items = fontCategory.sizes - textSize = textSizePicker.items[0] + if textSizePicker.items.count > 0 { + textSize = textSizePicker.items[0] + } else { + textSize = nil + } updateLabelStyle() } } - private var textSize: TypographicalStyle.FontSize = .large { + private var textSize: TypographicalStyle.FontSize? = .large { didSet { - textSizeLabel.text = textSize.rawValue + textSizeLabel.text = textSize?.rawValue ?? "" updateLabelStyle() }