diff --git a/VDS/Components/Label/Attributes/TooltipLabelAttribute.swift b/VDS/Components/Label/Attributes/TooltipLabelAttribute.swift index 5d5baa8d..b061d747 100644 --- a/VDS/Components/Label/Attributes/TooltipLabelAttribute.swift +++ b/VDS/Components/Label/Attributes/TooltipLabelAttribute.swift @@ -50,24 +50,17 @@ public class TooltipLabelAttribute: ActionLabelAttributeModel, TooltipLaunchable frame = CGRect(x: 0, y: -1, width: size.value.dimensions.width, height: size.value.dimensions.height) } } - - //create the frame in which to hold the icon - let spacerframe = CGRect(x: 0, y: 0, width: VDSLayout.Spacing.space1X.value, height: size.value.dimensions.height) - + //create the image icon and match the color of the text let tooltipAttribute = ImageLabelAttribute(location: location, imageName: "info", frame: frame, tintColor: imageTintColor) - let spacerAttribute = ImageLabelAttribute(location: location, - imageName: "info", - frame: spacerframe, - tintColor: .clear) + let spacer = NSAttributedString.spacer(for: VDSLayout.Spacing.space1X.value) - guard let tooltip = try? tooltipAttribute.getAttachment(), - let spacer = try? spacerAttribute.getAttachment() else { return } - attributedString.append(NSAttributedString(attachment: spacer)) + guard let tooltip = try? tooltipAttribute.getAttachment() else { return } + attributedString.append(spacer) attributedString.append(NSAttributedString(attachment: tooltip)) addHandler(on: attributedString) }