From e36d487d326f710d7302c6d9bcb758d209ad329c Mon Sep 17 00:00:00 2001 From: panxi Date: Fri, 20 Dec 2019 15:00:42 -0500 Subject: [PATCH] change model name to containerModel to avoid compiling error --- MVMCoreUI/Containers/Container.swift | 4 +-- MVMCoreUI/Molecules/Items/StackItem.swift | 4 +-- MVMCoreUI/Molecules/ModuleMolecule.swift | 2 +- MVMCoreUI/Molecules/StandardHeaderView.swift | 38 ++++++++++---------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/MVMCoreUI/Containers/Container.swift b/MVMCoreUI/Containers/Container.swift index 069cd9e3..6beb72e0 100644 --- a/MVMCoreUI/Containers/Container.swift +++ b/MVMCoreUI/Containers/Container.swift @@ -185,7 +185,7 @@ public class ContainerHelper: NSObject { } open class Container: View { - var model: ContainerModelProtocol? + var containerModel: ContainerModelProtocol? var view: UIView? let containerHelper = ContainerHelper() @@ -198,7 +198,7 @@ public extension Container { override func updateView(_ size: CGFloat) { super.updateView(size) (view as? MVMCoreViewProtocol)?.updateView(size) - MFStyler.setMarginsFor(self, size: size, defaultHorizontal: model?.useHorizontalMargins ?? true, top: model?.useHorizontalMargins ?? true ? topMarginPadding : 0, bottom: model?.useHorizontalMargins ?? true ? bottomMarginPadding : 0) + MFStyler.setMarginsFor(self, size: size, defaultHorizontal: containerModel?.useHorizontalMargins ?? true, top: containerModel?.useHorizontalMargins ?? true ? topMarginPadding : 0, bottom: containerModel?.useHorizontalMargins ?? true ? bottomMarginPadding : 0) } /// Will be called only once. diff --git a/MVMCoreUI/Molecules/Items/StackItem.swift b/MVMCoreUI/Molecules/Items/StackItem.swift index 6ee5ae88..88dd5c43 100644 --- a/MVMCoreUI/Molecules/Items/StackItem.swift +++ b/MVMCoreUI/Molecules/Items/StackItem.swift @@ -20,12 +20,12 @@ open class StackItemModel: ContainerModelProtocol { init(with view: StackItem) { self.view = view - view.model = self + view.containerModel = self } init(with view: StackItem, json: [AnyHashable: Any]?) { self.view = view - view.model = self + view.containerModel = self update(with: json) } diff --git a/MVMCoreUI/Molecules/ModuleMolecule.swift b/MVMCoreUI/Molecules/ModuleMolecule.swift index 66e18d47..18dc43fa 100644 --- a/MVMCoreUI/Molecules/ModuleMolecule.swift +++ b/MVMCoreUI/Molecules/ModuleMolecule.swift @@ -18,7 +18,7 @@ struct ModuleMoleculeModel: ContainerModelProtocol { open class ModuleMolecule: Container { public override func setupView() { super.setupView() - model = ModuleMoleculeModel() + containerModel = ModuleMoleculeModel() } // MARK: - MVMCoreUIMoleculeViewProtocol diff --git a/MVMCoreUI/Molecules/StandardHeaderView.swift b/MVMCoreUI/Molecules/StandardHeaderView.swift index dba3fde2..8ed1a879 100644 --- a/MVMCoreUI/Molecules/StandardHeaderView.swift +++ b/MVMCoreUI/Molecules/StandardHeaderView.swift @@ -40,25 +40,25 @@ public class StandardHeaderView: MoleculeContainer { } } - open func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [String : AnyHashable]?) { - //TODO: Need to create setWithModel in ViewConstraining View - - #warning("This below call should be repaced with super.setWithModel once we get rid of ViewConstrainingView.") - //TODO: This below call should be repaced with super.setWithModel once we get rid of ViewConstrainingView. - setUpWithModel(model, delegateObject, additionalData) - - // This molecule will by default handle margins. - (molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetHorizontalMargins?(false) - (molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetVerticalMargins?(false) - - guard let headerModel = model as? HeaderModel else { - return - } - - if let seperatorModel = headerModel.seperator as? LineModel { - line?.setWithJSON(seperatorModel.toJSON(), delegateObject: delegateObject, additionalData: additionalData) - } - } +// open func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [String : AnyHashable]?) { +// //TODO: Need to create setWithModel in ViewConstraining View +// +// #warning("This below call should be repaced with super.setWithModel once we get rid of ViewConstrainingView.") +// //TODO: This below call should be repaced with super.setWithModel once we get rid of ViewConstrainingView. +// setUpWithModel(model, delegateObject, additionalData) +// +// // This molecule will by default handle margins. +// (molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetHorizontalMargins?(false) +// (molecule as? MVMCoreUIViewConstrainingProtocol)?.shouldSetVerticalMargins?(false) +// +// guard let headerModel = model as? HeaderModel else { +// return +// } +// +// if let seperatorModel = headerModel.seperator as? LineModel { +// line?.setWithJSON(seperatorModel.toJSON(), delegateObject: delegateObject, additionalData: additionalData) +// } +// } open override func reset() { super.reset()