updated to call helper method

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-01-10 12:36:32 -06:00
parent 8b523c971a
commit 34300a7f9c

View File

@ -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) {