Call super reset in vcv. Further adjustments to atom.
This commit is contained in:
parent
4fc5ff9313
commit
57f82aa60a
@ -24,7 +24,7 @@ import UIKit
|
||||
// MARK: - Properties
|
||||
//------------------------------------------------------
|
||||
|
||||
var textPadding: CGFloat = PaddingOne
|
||||
var titlePadding: CGFloat = PaddingOne
|
||||
|
||||
//------------------------------------------------------
|
||||
// MARK: - Constraints
|
||||
@ -62,12 +62,12 @@ import UIKit
|
||||
override open func setupView() {
|
||||
super.setupView()
|
||||
|
||||
imageLoader.addSizeConstraintsForAspectRatio = true
|
||||
|
||||
guard subviews.isEmpty else { return }
|
||||
|
||||
button.setAsSecondaryCustom()
|
||||
button.isHidden = false
|
||||
imageLoader.imageView.contentMode = .scaleAspectFit
|
||||
imageLoader.addSizeConstraintsForAspectRatio = true
|
||||
|
||||
addSubview(leftContainer)
|
||||
addSubview(imageLoader)
|
||||
@ -121,9 +121,9 @@ import UIKit
|
||||
imageLoader.updateView(size)
|
||||
leftContainer.updateView(size)
|
||||
|
||||
let titlePadding = title.hasText ? textPadding : 0
|
||||
messageTopConstraint?.constant = titlePadding
|
||||
buttonTopConstraint?.constant = message.hasText ? PaddingTwo : titlePadding
|
||||
let topPadding = title.hasText ? titlePadding : 0
|
||||
messageTopConstraint?.constant = topPadding
|
||||
buttonTopConstraint?.constant = message.hasText ? PaddingTwo : topPadding
|
||||
}
|
||||
|
||||
public override static func estimatedHeight(forRow json: [AnyHashable: Any]?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
|
||||
@ -152,11 +152,18 @@ import UIKit
|
||||
|
||||
guard let dictionary = json else { return }
|
||||
|
||||
textPadding = dictionary.optionalCGFloatForKey("textPadding") ?? 0.0
|
||||
if let padding = dictionary.optionalCGFloatForKey("titlePadding") {
|
||||
titlePadding = padding
|
||||
}
|
||||
|
||||
title.setWithJSON(dictionary.optionalDictionaryForKey("title"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
message.setWithJSON(dictionary.optionalDictionaryForKey("message"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
button.setWithJSON(dictionary.optionalDictionaryForKey("button"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
imageLoader.setWithJSON(dictionary.optionalDictionaryForKey("image"), delegateObject: delegateObject, additionalData: additionalData)
|
||||
if let buttonDictionary = dictionary.optionalDictionaryForKey("button") {
|
||||
button.setWithJSON(buttonDictionary, delegateObject: delegateObject, additionalData: additionalData)
|
||||
button.isHidden = false
|
||||
} else {
|
||||
button.isHidden = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -336,6 +336,7 @@
|
||||
}
|
||||
|
||||
- (void)reset {
|
||||
[super reset];
|
||||
self.updateViewHorizontalDefaults = NO;
|
||||
self.updateViewVerticalDefaults = NO;
|
||||
if ([self.molecule respondsToSelector:@selector(alignment)]) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user