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() {
self.translatesAutoresizingMaskIntoConstraints = false;
self.backgroundColor = .clear
self.contentMode = .redraw
self.setTitleColor(.mfTextButton(), for: .normal)
self.setTitleColor(.mfCharcoal(), for: .highlighted)
translatesAutoresizingMaskIntoConstraints = false
backgroundColor = .clear
contentMode = .redraw
setTitleColor(.mfTextButton(), for: .normal)
setTitleColor(.mfCharcoal(), for: .highlighted)
// left alignment by default
self.titleLabel?.textAlignment = .left
self.contentHorizontalAlignment = .left
titleLabel?.textAlignment = .left
contentHorizontalAlignment = .left
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)
self.addConstraint(heightConstraint)
addConstraint(heightConstraint)
heightConstraint.isActive = true
self.heightConstraint = heightConstraint
}
@ -120,9 +120,9 @@ extension Link: MVMCoreUIMoleculeViewProtocol {
let color = unwrappedJson.stringForkey(KeyTextColor)
setTitleColor(.mfGet(forHex: color), for: .normal)
self.titleLabel?.numberOfLines = 0
self.titleLabel?.lineBreakMode = .byWordWrapping;
self.setTitle(actionMap?.stringForkey(KeyTitle), for: .normal)
titleLabel?.numberOfLines = 0
titleLabel?.lineBreakMode = .byWordWrapping;
setTitle(actionMap?.stringForkey(KeyTitle), for: .normal)
if let enabled = unwrappedJson[KeyEnabled] as? Bool {
isEnabled = enabled
@ -134,7 +134,7 @@ extension Link: MVMCoreUIMoleculeViewProtocol {
self.heightConstraint?.constant = 0
} else {
guard let standardSize = sizeObject?.standardSize else { return }
self.heightConstraint?.constant = standardSize
heightConstraint?.constant = standardSize
}
}