updated tint color
Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
d92b9c0c5d
commit
1fa97266c7
@ -20,7 +20,7 @@ public struct ImageLabelAttribute: AttachmentLabelAttributeModel {
|
|||||||
public var imageName: String?
|
public var imageName: String?
|
||||||
public var image: UIImage?
|
public var image: UIImage?
|
||||||
public var frame: CGRect?
|
public var frame: CGRect?
|
||||||
public var tintColor: UIColor
|
public var tintColor: UIColor?
|
||||||
public static func == (lhs: ImageLabelAttribute, rhs: ImageLabelAttribute) -> Bool {
|
public static func == (lhs: ImageLabelAttribute, rhs: ImageLabelAttribute) -> Bool {
|
||||||
lhs.isEqual(rhs)
|
lhs.isEqual(rhs)
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ public struct ImageLabelAttribute: AttachmentLabelAttributeModel {
|
|||||||
|
|
||||||
private func imageAttachment(image: UIImage) -> NSTextAttachment {
|
private func imageAttachment(image: UIImage) -> NSTextAttachment {
|
||||||
let attachment = 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)
|
attachment.bounds = frame ?? .init(x: 0, y: 0, width: image.size.width, height: image.size.height)
|
||||||
return attachment
|
return attachment
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user