From f44ac60f88333ff2358b9c803c6aeb98702de05a Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Wed, 17 Aug 2022 14:27:57 -0500 Subject: [PATCH] udpated code for micro fix Signed-off-by: Matt Bruce --- VDSSample/ViewControllers/LabelViewController.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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() }