Now subclassing Button.

This commit is contained in:
Kevin G Christiano 2020-01-13 16:19:49 -05:00
parent d7844d607e
commit 3d2137fc11

View File

@ -9,7 +9,7 @@
import UIKit
@objcMembers open class Link: MFCustomButton {
@objcMembers open class Link: Button {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
@ -85,19 +85,11 @@ import UIKit
}
}
// MARK: - AppleGuidelinesProtocol
extension Link: AppleGuidelinesProtocol {
override open func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
return Self.acceptablyOutsideBounds(point: point, bounds: bounds)
}
}
// MARK: - MVMCoreViewProtocol
extension Link: MVMCoreViewProtocol {
extension Link {
public func updateView(_ size: CGFloat) {
public override func updateView(_ size: CGFloat) {
super.updateView(size)
DispatchQueue.main.async { [weak self] in
guard let self = self else { return }
@ -111,7 +103,7 @@ extension Link: MVMCoreViewProtocol {
}
}
public func setupView() {
public override func setupView() {
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = .clear
@ -127,13 +119,15 @@ extension Link: MVMCoreViewProtocol {
}
// MARK: - MVMCoreUIMoleculeViewProtocol
extension Link: MVMCoreUIMoleculeViewProtocol {
extension Link {
public func reset() {
public override func reset() {
super.reset()
setTitleColor(.mfTextButton(), for: .normal)
}
public func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
public override func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
self.additionalData = additionalData
self.delegateObject = delegateObject
buttonDelegate = delegateObject?.buttonDelegate