From 436e9035d24cb338d65ef4aea8a85d3b84b90a97 Mon Sep 17 00:00:00 2001 From: "Pfeil, Scott Robert" Date: Wed, 3 Jul 2019 13:21:52 -0400 Subject: [PATCH] resolve discussions --- MVMCoreUI/Atoms/Views/ViewConstrainingView.h | 2 +- MVMCoreUI/Atoms/Views/ViewConstrainingView.m | 3 ++- MVMCoreUI/Molecules/StandardFooterView.swift | 2 +- MVMCoreUI/Molecules/StandardHeaderView.swift | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/MVMCoreUI/Atoms/Views/ViewConstrainingView.h b/MVMCoreUI/Atoms/Views/ViewConstrainingView.h index 9ec6c193..a98a181d 100644 --- a/MVMCoreUI/Atoms/Views/ViewConstrainingView.h +++ b/MVMCoreUI/Atoms/Views/ViewConstrainingView.h @@ -37,7 +37,7 @@ @property (weak, nullable, nonatomic) UIView *molecule; /// A flag for if we should add a molecule from json. -@property (nonatomic) BOOL setupMoleculeFromJSON; +@property (nonatomic) BOOL shouldSetupMoleculeFromJSON; // Returns an empty view + (nonnull ViewConstrainingView *)emptyView; diff --git a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m index 093e1ecc..1f6b568f 100644 --- a/MVMCoreUI/Atoms/Views/ViewConstrainingView.m +++ b/MVMCoreUI/Atoms/Views/ViewConstrainingView.m @@ -341,7 +341,7 @@ [super 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]; if (moleculeJSON) { UIView *molecule = [[MVMCoreUIMoleculeMappingObject sharedMappingObject] createMoleculeForJSON:moleculeJSON delegateObject:delegateObject constrainIfNeeded:true]; @@ -349,6 +349,7 @@ [self insertSubview:molecule atIndex:0]; [self pinViewToSuperView:molecule]; } + self.molecule = molecule; } } if (self.molecule) { diff --git a/MVMCoreUI/Molecules/StandardFooterView.swift b/MVMCoreUI/Molecules/StandardFooterView.swift index a135ccc0..59f7c0a9 100644 --- a/MVMCoreUI/Molecules/StandardFooterView.swift +++ b/MVMCoreUI/Molecules/StandardFooterView.swift @@ -11,7 +11,7 @@ import UIKit open class StandardFooterView: ViewConstrainingView { open override func setupView() { super.setupView() - setupMoleculeFromJSON = true + shouldSetupMoleculeFromJSON = true } open override func setWithJSON(_ json: [AnyHashable : Any]?, delegateObject: MVMCoreUIDelegateObject?, additionalData: [AnyHashable : Any]?) { diff --git a/MVMCoreUI/Molecules/StandardHeaderView.swift b/MVMCoreUI/Molecules/StandardHeaderView.swift index ff5b8538..bf6e2580 100644 --- a/MVMCoreUI/Molecules/StandardHeaderView.swift +++ b/MVMCoreUI/Molecules/StandardHeaderView.swift @@ -19,7 +19,7 @@ public class StandardHeaderView: ViewConstrainingView { public override func setupView() { super.setupView() - setupMoleculeFromJSON = true + shouldSetupMoleculeFromJSON = true if separatorView == nil, let separatorView = SeparatorView.separatorAdd(to: self, position: SeparatorPositionBot, withHorizontalPadding: 0) { separatorView.setAsHeavy() addSubview(separatorView)