From 6e233e9babec0e320c42f301f1630e4d505fa1e0 Mon Sep 17 00:00:00 2001 From: "Robinson, Blake" Date: Thu, 19 Dec 2019 12:23:18 -0500 Subject: [PATCH] Removes self where unnecessary --- MVMCoreUI/Atoms/Buttons/Link.swift | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/MVMCoreUI/Atoms/Buttons/Link.swift b/MVMCoreUI/Atoms/Buttons/Link.swift index b31b2c34..068227b7 100644 --- a/MVMCoreUI/Atoms/Buttons/Link.swift +++ b/MVMCoreUI/Atoms/Buttons/Link.swift @@ -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