change model name to containerModel to avoid compiling error
This commit is contained in:
parent
ca1a6f8c83
commit
e36d487d32
@ -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.
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ struct ModuleMoleculeModel: ContainerModelProtocol {
|
||||
open class ModuleMolecule: Container {
|
||||
public override func setupView() {
|
||||
super.setupView()
|
||||
model = ModuleMoleculeModel()
|
||||
containerModel = ModuleMoleculeModel()
|
||||
}
|
||||
|
||||
// MARK: - MVMCoreUIMoleculeViewProtocol
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user