Remove self where it is not necessary for clarity

This commit is contained in:
Robinson, Blake 2019-12-12 10:00:59 -05:00
parent b8e0fbff75
commit 3001f1df78

View File

@ -86,18 +86,18 @@ extension Link: MVMCoreViewProtocol {
} }
public func setupView() { public func setupView() {
self.translatesAutoresizingMaskIntoConstraints = false; translatesAutoresizingMaskIntoConstraints = false
self.backgroundColor = .clear backgroundColor = .clear
self.contentMode = .redraw contentMode = .redraw
self.setTitleColor(.mfTextButton(), for: .normal) setTitleColor(.mfTextButton(), for: .normal)
self.setTitleColor(.mfCharcoal(), for: .highlighted) setTitleColor(.mfCharcoal(), for: .highlighted)
// left alignment by default // left alignment by default
self.titleLabel?.textAlignment = .left titleLabel?.textAlignment = .left
self.contentHorizontalAlignment = .left contentHorizontalAlignment = .left
if let constant = self.sizeObject?.standardSize { if let constant = self.sizeObject?.standardSize {
let heightConstraint = NSLayoutConstraint(item: self as Any, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: constant) let heightConstraint = NSLayoutConstraint(item: self as Any, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: constant)
self.addConstraint(heightConstraint) addConstraint(heightConstraint)
heightConstraint.isActive = true heightConstraint.isActive = true
self.heightConstraint = heightConstraint self.heightConstraint = heightConstraint
} }
@ -120,9 +120,9 @@ extension Link: MVMCoreUIMoleculeViewProtocol {
let color = unwrappedJson.stringForkey(KeyTextColor) let color = unwrappedJson.stringForkey(KeyTextColor)
setTitleColor(.mfGet(forHex: color), for: .normal) setTitleColor(.mfGet(forHex: color), for: .normal)
self.titleLabel?.numberOfLines = 0 titleLabel?.numberOfLines = 0
self.titleLabel?.lineBreakMode = .byWordWrapping; titleLabel?.lineBreakMode = .byWordWrapping;
self.setTitle(actionMap?.stringForkey(KeyTitle), for: .normal) setTitle(actionMap?.stringForkey(KeyTitle), for: .normal)
if let enabled = unwrappedJson[KeyEnabled] as? Bool { if let enabled = unwrappedJson[KeyEnabled] as? Bool {
isEnabled = enabled isEnabled = enabled
@ -134,7 +134,7 @@ extension Link: MVMCoreUIMoleculeViewProtocol {
self.heightConstraint?.constant = 0 self.heightConstraint?.constant = 0
} else { } else {
guard let standardSize = sizeObject?.standardSize else { return } guard let standardSize = sizeObject?.standardSize else { return }
self.heightConstraint?.constant = standardSize heightConstraint?.constant = standardSize
} }
} }