From 1fa97266c7b87e17b8b8541d5f7cd04626a28a96 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Thu, 3 Nov 2022 10:47:09 -0500 Subject: [PATCH] updated tint color Signed-off-by: Matt Bruce --- VDS/Components/Label/Attributes/ImageLabelAttribute.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VDS/Components/Label/Attributes/ImageLabelAttribute.swift b/VDS/Components/Label/Attributes/ImageLabelAttribute.swift index 92403082..bf6e067a 100644 --- a/VDS/Components/Label/Attributes/ImageLabelAttribute.swift +++ b/VDS/Components/Label/Attributes/ImageLabelAttribute.swift @@ -20,7 +20,7 @@ public struct ImageLabelAttribute: AttachmentLabelAttributeModel { public var imageName: String? public var image: UIImage? public var frame: CGRect? - public var tintColor: UIColor + public var tintColor: UIColor? public static func == (lhs: ImageLabelAttribute, rhs: ImageLabelAttribute) -> Bool { lhs.isEqual(rhs) } @@ -31,7 +31,7 @@ public struct ImageLabelAttribute: AttachmentLabelAttributeModel { private func imageAttachment(image: UIImage) -> NSTextAttachment { let attachment = NSTextAttachment() - attachment.image = image.withTintColor(tintColor) + attachment.image = tintColor != nil ? image.withTintColor(tintColor!) : image attachment.bounds = frame ?? .init(x: 0, y: 0, width: image.size.width, height: image.size.height) return attachment }