Removed heightConstraint-related logic because the heightConstraint was added to increase the tappable area of Link's predecessor, MFTextButton.

This commit is contained in:
Robinson, Blake 2019-12-19 13:13:57 -05:00
parent 6e233e9bab
commit 8d417068a9

View File

@ -10,10 +10,6 @@ import UIKit
@objcMembers open class Link: MFCustomButton {
private lazy var sizeObject: MFSizeObject? = {
return MFSizeObject(standardSize: 30, standardiPadPortraitSize: 36, iPadProLandscapeSize: 42)
}()
private var additionalData: [AnyHashable: Any]?
private var delegateObject: MVMCoreUIDelegateObject?
@ -71,11 +67,6 @@ extension Link: MVMCoreViewProtocol {
width = MVMCoreUIUtility.getWidth()
}
self.titleLabel?.font = MFStyler.fontB2(forWidth: width)
guard let heightConstraint = self.heightConstraint else { return }
if !MVMCoreGetterUtility.fequal(a: 0, b: Float(heightConstraint.constant)) {
guard let sizeObject = self.sizeObject else { return }
self.heightConstraint?.constant = sizeObject.getValueBased(onSize: width)
}
})
}
@ -88,13 +79,6 @@ extension Link: MVMCoreViewProtocol {
// left alignment by default
titleLabel?.textAlignment = .left
contentHorizontalAlignment = .left
if let constant = sizeObject?.standardSize {
let heightConstraint = NSLayoutConstraint(item: self as Any, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: constant)
addConstraint(heightConstraint)
heightConstraint.isActive = true
self.heightConstraint = heightConstraint
}
}
}
@ -122,14 +106,6 @@ extension Link: MVMCoreUIMoleculeViewProtocol {
isEnabled = enabled
}
}
if let title = title(for: .normal),
title.isEmpty {
heightConstraint?.constant = 0
} else {
guard let standardSize = sizeObject?.standardSize else { return }
heightConstraint?.constant = standardSize
}
}
public static func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {