From 34300a7f9cc91cc39a799675bd8511dcba8d35e8 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 10 Jan 2023 12:36:32 -0600 Subject: [PATCH] updated to call helper method Signed-off-by: Matt Bruce --- VDS/Components/Icon/Icon.swift | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/VDS/Components/Icon/Icon.swift b/VDS/Components/Icon/Icon.swift index 618282f0..774a4df8 100644 --- a/VDS/Components/Icon/Icon.swift +++ b/VDS/Components/Icon/Icon.swift @@ -124,27 +124,13 @@ public class Icon: View { } private func getImage(for imageName: String) -> UIImage? { - if !imageName.hasPrefix("pagination"), isBold { - let boldIconName = "\(imageName)-bold" - if let image = UIImage(named: boldIconName, in: Bundle(for: Self.self), with: nil) { - return image - - } else if let image = UIImage(named: boldIconName) { - return image - - } else if let image = UIImage(named: imageName) { - return image - } - } else { - if let image = UIImage(named: imageName, in: Bundle(for: Self.self), with: nil) { - return image - - } else if let image = UIImage(named: imageName) { - return image - } - } - return nil + //if the icon isBold (restricted internal) attach bold but + //some might not be found so then try the normal un-bold name + if isBold { + return BundleManager.shared.image(for: "\(imageName)-bold") + } + return BundleManager.shared.image(for: imageName) } private func setImage(image: UIImage, imageColor: UIColor) {