revert back to original

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2023-08-23 09:54:24 -05:00
parent ee48532cce
commit cfe0f6135b

View File

@ -19,6 +19,10 @@ open class TextLink: ButtonBase {
//-------------------------------------------------- //--------------------------------------------------
private var lineHeightConstraint: NSLayoutConstraint? private var lineHeightConstraint: NSLayoutConstraint?
private var line = UIView().with {
$0.translatesAutoresizingMaskIntoConstraints = false
}
//-------------------------------------------------- //--------------------------------------------------
// MARK: - Properties // MARK: - Properties
//-------------------------------------------------- //--------------------------------------------------
@ -72,7 +76,13 @@ open class TextLink: ButtonBase {
isAccessibilityElement = true isAccessibilityElement = true
accessibilityTraits = .link accessibilityTraits = .link
if let titleLabel { if let titleLabel {
titleLabel.debugBorder(show: true) addSubview(line)
line.pinLeading(titleLabel.leadingAnchor)
line.pinTrailing(titleLabel.trailingAnchor)
line.pinTop(titleLabel.bottomAnchor)
line.pinBottom(bottomAnchor, 0, .defaultHigh)
lineHeightConstraint = line.heightAnchor.constraint(equalToConstant: 1.0)
lineHeightConstraint?.isActive = true
} }
} }
@ -96,8 +106,13 @@ open class TextLink: ButtonBase {
return titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize return titleLabel?.intrinsicContentSize ?? super.intrinsicContentSize
} }
open override func layoutSubviews() { /// Function used to make changes to the View based off a change events or from local properties.
super.layoutSubviews() open override func updateView() {
addBorder(side: .bottom, width: 1, color: textColor) //need to set the properties so the super class
//can render out the label correctly
line.backgroundColor = textColor
//always call last so the label is rendered
super.updateView()
} }
} }