Removes self where unnecessary

This commit is contained in:
Robinson, Blake 2019-12-19 12:23:18 -05:00
parent 7c17889b57
commit 6e233e9bab

View File

@ -19,21 +19,21 @@ import UIKit
public override init(frame: CGRect) {
super.init(frame: frame)
self.setupView()
setupView()
}
public required init?(coder: NSCoder) {
super.init(coder: coder)
self.setupView()
setupView()
}
open override func draw(_ rect: CGRect) {
guard let textRect = self.titleLabel?.frame else { return }
guard let textRect = titleLabel?.frame else { return }
let contextRef = UIGraphicsGetCurrentContext()
//set to the same color as the text
if let color = self.titleLabel?.textColor?.cgColor {
if let color = titleLabel?.textColor?.cgColor {
contextRef?.setStrokeColor(color)
}
@ -89,7 +89,7 @@ extension Link: MVMCoreViewProtocol {
titleLabel?.textAlignment = .left
contentHorizontalAlignment = .left
if let constant = self.sizeObject?.standardSize {
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
@ -101,7 +101,7 @@ extension Link: MVMCoreViewProtocol {
extension Link: MVMCoreUIMoleculeViewProtocol {
public func reset() {
self.setTitleColor(.mfTextButton(), for: .normal)
setTitleColor(.mfTextButton(), for: .normal)
}
public func setWithJSON(_ json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable: Any]?) {
@ -123,9 +123,9 @@ extension Link: MVMCoreUIMoleculeViewProtocol {
}
}
if let title = self.title(for: .normal),
if let title = title(for: .normal),
title.isEmpty {
self.heightConstraint?.constant = 0
heightConstraint?.constant = 0
} else {
guard let standardSize = sizeObject?.standardSize else { return }
heightConstraint?.constant = standardSize