resolve discussions

This commit is contained in:
Pfeil, Scott Robert 2019-07-03 13:21:52 -04:00
parent f6021bb382
commit 436e9035d2
4 changed files with 5 additions and 4 deletions

View File

@ -37,7 +37,7 @@
@property (weak, nullable, nonatomic) UIView <MVMCoreUIMoleculeViewProtocol>*molecule; @property (weak, nullable, nonatomic) UIView <MVMCoreUIMoleculeViewProtocol>*molecule;
/// A flag for if we should add a molecule from json. /// A flag for if we should add a molecule from json.
@property (nonatomic) BOOL setupMoleculeFromJSON; @property (nonatomic) BOOL shouldSetupMoleculeFromJSON;
// Returns an empty view // Returns an empty view
+ (nonnull ViewConstrainingView *)emptyView; + (nonnull ViewConstrainingView *)emptyView;

View File

@ -341,7 +341,7 @@
[super setWithJSON:json delegateObject:delegateObject additionalData:additionalData]; [super setWithJSON:json delegateObject:delegateObject additionalData:additionalData];
[self.molecule setWithJSON:json delegateObject:delegateObject additionalData:additionalData]; [self.molecule setWithJSON:json delegateObject:delegateObject additionalData:additionalData];
if (self.setupMoleculeFromJSON && !self.molecule) { if (self.shouldSetupMoleculeFromJSON && !self.molecule) {
NSDictionary *moleculeJSON = [json dict:KeyMolecule]; NSDictionary *moleculeJSON = [json dict:KeyMolecule];
if (moleculeJSON) { if (moleculeJSON) {
UIView <MVMCoreUIMoleculeViewProtocol>*molecule = [[MVMCoreUIMoleculeMappingObject sharedMappingObject] createMoleculeForJSON:moleculeJSON delegateObject:delegateObject constrainIfNeeded:true]; UIView <MVMCoreUIMoleculeViewProtocol>*molecule = [[MVMCoreUIMoleculeMappingObject sharedMappingObject] createMoleculeForJSON:moleculeJSON delegateObject:delegateObject constrainIfNeeded:true];
@ -349,6 +349,7 @@
[self insertSubview:molecule atIndex:0]; [self insertSubview:molecule atIndex:0];
[self pinViewToSuperView:molecule]; [self pinViewToSuperView:molecule];
} }
self.molecule = molecule;
} }
} }
if (self.molecule) { if (self.molecule) {

View File

@ -11,7 +11,7 @@ import UIKit
open class StandardFooterView: ViewConstrainingView { open class StandardFooterView: ViewConstrainingView {
open override func setupView() { open override func setupView() {
super.setupView() super.setupView()
setupMoleculeFromJSON = true shouldSetupMoleculeFromJSON = true
} }
open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) {

View File

@ -19,7 +19,7 @@ public class StandardHeaderView: ViewConstrainingView {
public override func setupView() { public override func setupView() {
super.setupView() super.setupView()
setupMoleculeFromJSON = true shouldSetupMoleculeFromJSON = true
if separatorView == nil, let separatorView = SeparatorView.separatorAdd(to: self, position: SeparatorPositionBot, withHorizontalPadding: 0) { if separatorView == nil, let separatorView = SeparatorView.separatorAdd(to: self, position: SeparatorPositionBot, withHorizontalPadding: 0) {
separatorView.setAsHeavy() separatorView.setAsHeavy()
addSubview(separatorView) addSubview(separatorView)