This commit is contained in:
Pfeil, Scott Robert 2020-01-21 15:33:27 -05:00
parent 42b57dcd5d
commit f5ed509a39
96 changed files with 177 additions and 177 deletions

View File

@ -17,9 +17,9 @@
011B58F423A2CCC80085F53C /* DropDownModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 011B58F323A2CCC80085F53C /* DropDownModel.swift */; };
012A889C23889E8400FE3DA1 /* TemplateModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A889B23889E8400FE3DA1 /* TemplateModelProtocol.swift */; };
012A88AD238C418100FE3DA1 /* TemplateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88AC238C418100FE3DA1 /* TemplateProtocol.swift */; };
012A88B1238C880100FE3DA1 /* PagingMoleculeProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88B0238C880100FE3DA1 /* PagingMoleculeProtocol.swift */; };
012A88B1238C880100FE3DA1 /* CarouselPagingModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88B0238C880100FE3DA1 /* CarouselPagingModelProtocol.swift */; };
012A88C2238D7BCA00FE3DA1 /* CarouselItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88C1238D7BCA00FE3DA1 /* CarouselItemModel.swift */; };
012A88C4238D86E600FE3DA1 /* CollectionCellMoleculeProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88C3238D86E600FE3DA1 /* CollectionCellMoleculeProtocol.swift */; };
012A88C4238D86E600FE3DA1 /* CarouselItemModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88C3238D86E600FE3DA1 /* CarouselItemModelProtocol.swift */; };
012A88C6238DA34000FE3DA1 /* ModuleMoleculeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88C5238DA34000FE3DA1 /* ModuleMoleculeModel.swift */; };
012A88C8238DB02000FE3DA1 /* ModelMoleculeDelegateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88C7238DB02000FE3DA1 /* ModelMoleculeDelegateProtocol.swift */; };
012A88DB238ED45900FE3DA1 /* CarouselModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88AE238C626E00FE3DA1 /* CarouselModel.swift */; };
@ -52,7 +52,7 @@
0198F7A82256A80B0066C936 /* MFRadioButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 0198F7A22256A80A0066C936 /* MFRadioButton.m */; };
01C851D323CF9E740021F976 /* LabelToggleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01C851D223CF9E740021F976 /* LabelToggleModel.swift */; };
01E569D3223FFFA500327251 /* ThreeLayerViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = D2A5146A2214905000345BFB /* ThreeLayerViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
01EB3684236097C0006832FA /* MoleculeProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB3683236097C0006832FA /* MoleculeProtocol.swift */; };
01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB3683236097C0006832FA /* MoleculeModelProtocol.swift */; };
01EB368F23609801006832FA /* LabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368823609801006832FA /* LabelModel.swift */; };
01EB369023609801006832FA /* ListItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368923609801006832FA /* ListItemModel.swift */; };
01EB369223609801006832FA /* MoleculeStackModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368B23609801006832FA /* MoleculeStackModel.swift */; };
@ -320,9 +320,9 @@
012A889B23889E8400FE3DA1 /* TemplateModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemplateModelProtocol.swift; sourceTree = "<group>"; };
012A88AC238C418100FE3DA1 /* TemplateProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemplateProtocol.swift; sourceTree = "<group>"; };
012A88AE238C626E00FE3DA1 /* CarouselModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselModel.swift; sourceTree = "<group>"; };
012A88B0238C880100FE3DA1 /* PagingMoleculeProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PagingMoleculeProtocol.swift; sourceTree = "<group>"; };
012A88B0238C880100FE3DA1 /* CarouselPagingModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselPagingModelProtocol.swift; sourceTree = "<group>"; };
012A88C1238D7BCA00FE3DA1 /* CarouselItemModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselItemModel.swift; sourceTree = "<group>"; };
012A88C3238D86E600FE3DA1 /* CollectionCellMoleculeProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionCellMoleculeProtocol.swift; sourceTree = "<group>"; };
012A88C3238D86E600FE3DA1 /* CarouselItemModelProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CarouselItemModelProtocol.swift; sourceTree = "<group>"; };
012A88C5238DA34000FE3DA1 /* ModuleMoleculeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModuleMoleculeModel.swift; sourceTree = "<group>"; };
012A88C7238DB02000FE3DA1 /* ModelMoleculeDelegateProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModelMoleculeDelegateProtocol.swift; sourceTree = "<group>"; };
012A88EB238F084D00FE3DA1 /* FooterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FooterModel.swift; sourceTree = "<group>"; };
@ -353,7 +353,7 @@
0198F7A02256A80A0066C936 /* MFRadioButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFRadioButton.h; sourceTree = "<group>"; };
0198F7A22256A80A0066C936 /* MFRadioButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFRadioButton.m; sourceTree = "<group>"; };
01C851D223CF9E740021F976 /* LabelToggleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelToggleModel.swift; sourceTree = "<group>"; };
01EB3683236097C0006832FA /* MoleculeProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeProtocol.swift; sourceTree = "<group>"; };
01EB3683236097C0006832FA /* MoleculeModelProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeModelProtocol.swift; sourceTree = "<group>"; };
01EB368823609801006832FA /* LabelModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LabelModel.swift; sourceTree = "<group>"; };
01EB368923609801006832FA /* ListItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ListItemModel.swift; sourceTree = "<group>"; };
01EB368A23609801006832FA /* MoleculeStackItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeStackItemModel.swift; sourceTree = "<group>"; };
@ -633,10 +633,9 @@
children = (
014AA72323C501E2006F3E93 /* ContainerModelProtocol.swift */,
017BEB4123620AD20024EF95 /* FormModelProtocol.swift */,
012A88C3238D86E600FE3DA1 /* CollectionCellMoleculeProtocol.swift */,
012A88B0238C880100FE3DA1 /* PagingMoleculeProtocol.swift */,
01EB3683236097C0006832FA /* MoleculeProtocol.swift */,
012A88AC238C418100FE3DA1 /* TemplateProtocol.swift */,
012A88C3238D86E600FE3DA1 /* CarouselItemModelProtocol.swift */,
012A88B0238C880100FE3DA1 /* CarouselPagingModelProtocol.swift */,
01EB3683236097C0006832FA /* MoleculeModelProtocol.swift */,
012A889B23889E8400FE3DA1 /* TemplateModelProtocol.swift */,
D28A837823C7D5BC00DFE4FC /* PageModelProtocol.swift */,
011B58EF23A2AA980085F53C /* ListItemModelProtocol.swift */,
@ -950,6 +949,7 @@
D29DF0DF21E418B2003B2FB9 /* Templates */ = {
isa = PBXGroup;
children = (
012A88AC238C418100FE3DA1 /* TemplateProtocol.swift */,
014AA72823C5059B006F3E93 /* StackPageTemplateModel.swift */,
D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */,
014AA72923C5059B006F3E93 /* StackCenteredPageTemplateModel.swift */,
@ -1533,7 +1533,7 @@
C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */,
014AA72D23C5059B006F3E93 /* StackPageTemplateModel.swift in Sources */,
D260106123D0C02A00764D80 /* StackItemModelProtocol.swift in Sources */,
012A88C4238D86E600FE3DA1 /* CollectionCellMoleculeProtocol.swift in Sources */,
012A88C4238D86E600FE3DA1 /* CarouselItemModelProtocol.swift in Sources */,
94C2D9AB23872EB50006CF46 /* LabelAttributeActionModel.swift in Sources */,
014AA73123C5059B006F3E93 /* ListPageTemplateModel.swift in Sources */,
017BEB4023620A230024EF95 /* TextFieldModel.swift in Sources */,
@ -1604,7 +1604,7 @@
D29DF27A21E7A533003B2FB9 /* MVMCoreUISession.m in Sources */,
D2A5146B2214905000345BFB /* ThreeLayerViewController.swift in Sources */,
D28A838F23CCDEDE00DFE4FC /* TwoButtonViewModel.swift in Sources */,
012A88B1238C880100FE3DA1 /* PagingMoleculeProtocol.swift in Sources */,
012A88B1238C880100FE3DA1 /* CarouselPagingModelProtocol.swift in Sources */,
D29DF2C921E7BFC6003B2FB9 /* MFSizeObject.m in Sources */,
9445890E2385C3F800DE9FD4 /* MultiProgressModel.swift in Sources */,
D2A6390522CBCE160052ED1F /* MoleculeCollectionViewCell.swift in Sources */,
@ -1629,7 +1629,7 @@
017BEB4A236235BA0024EF95 /* ModelMoleculeViewProtocol.swift in Sources */,
C695A68123C9830D00BFB94E /* NumberedListModel.swift in Sources */,
012CA99A2384A687003F810F /* MFTextField+ModelExtension.swift in Sources */,
01EB3684236097C0006832FA /* MoleculeProtocol.swift in Sources */,
01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */,
D27CD4102339057800C1DC07 /* EyebrowHeadlineBodyLink.swift in Sources */,
D29DF11D21E684A9003B2FB9 /* MVMCoreUISplitViewController.m in Sources */,
0198F79F225679880066C936 /* FormValidationProtocol.swift in Sources */,

View File

@ -18,7 +18,7 @@ public enum ButtonSize: String, Codable {
case tiny
}
public class ButtonModel: MoleculeProtocol {
public class ButtonModel: MoleculeModelProtocol {
public static var identifier: String = "button"
public var backgroundColor: Color?
public var title: String

View File

@ -141,7 +141,7 @@ open class CaretButton: MFCustomButton, MVMCoreUIMoleculeViewProtocol, MVMCoreUI
}
}
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let caretLinkModel = model as? CaretLinkModel else { return }
if let color = caretLinkModel.backgroundColor {
backgroundColor = color.uiColor

View File

@ -9,7 +9,7 @@
import Foundation
import MVMCore
public class CaretLinkModel: MoleculeProtocol {
public class CaretLinkModel: MoleculeModelProtocol {
public static var identifier: String = "caretLink"
public var backgroundColor: Color?
public var title: String

View File

@ -8,7 +8,7 @@
import UIKit
public class LinkModel: MoleculeProtocol {
public class LinkModel: MoleculeModelProtocol {
public static var identifier: String = "link"
public var backgroundColor: Color?
public var title: String

View File

@ -10,7 +10,7 @@ import UIKit
// temporary until link is finished
extension MFTextButton: ModelMoleculeViewProtocol {
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
guard let model = model as? LinkModel else { return }
setTitle(model.title, for: .normal)
setTitleColor(model.textColor.uiColor, for: .normal)

View File

@ -10,7 +10,7 @@ import Foundation
// temporary until link is finished
extension PrimaryButton: ModelMoleculeViewProtocol {
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
guard let model = model as? ButtonModel else { return }
setTitle(model.title, for: .normal)
backgroundColor = model.backgroundColor?.uiColor

View File

@ -16,7 +16,7 @@ enum TextType: String {
}
extension MFTextField: ModelMoleculeViewProtocol {
//
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
//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.

View File

@ -8,7 +8,7 @@
import UIKit
@objcMembers public class TextFieldModel: MoleculeProtocol, FormModelProtocol {
@objcMembers public class TextFieldModel: MoleculeModelProtocol, FormModelProtocol {
public static var identifier: String = "textField"
public var backgroundColor: Color?

View File

@ -188,7 +188,7 @@ open class CaretView: View {
}
//MARK: - MVMCoreMoleculeViewProtocol
override public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
override public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let caretModel = model as? CaretViewModel else {
return

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class CaretViewModel: MoleculeProtocol {
@objcMembers public class CaretViewModel: MoleculeModelProtocol {
public static var identifier: String = "caretView"
public var backgroundColor: Color?

View File

@ -16,7 +16,7 @@ public enum GraphStyle: String, Codable {
case unlimited, safetyMode
}
public class CircleProgressModel: MoleculeProtocol {
public class CircleProgressModel: MoleculeModelProtocol {
public static var identifier: String = "circleProgress"
public var style: GraphStyle = .unlimited {
didSet {

View File

@ -92,7 +92,7 @@ open class DashLine: View {
}
//MARK: - MVMCoreMoleculeViewProtocol
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let dashLineModel = dashModel else {
return

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class DashLineModel: MoleculeProtocol {
@objcMembers public class DashLineModel: MoleculeModelProtocol {
public static var identifier: String = "dashLine"
public var backgroundColor: Color?

View File

@ -9,7 +9,7 @@
import Foundation
@objcMembers public class DropDownModel: MoleculeProtocol {
@objcMembers public class DropDownModel: MoleculeModelProtocol {
public static var identifier: String = "dropDownModel"
public var backgroundColor: Color?
public var label: String

View File

@ -26,7 +26,7 @@ import UIKit
widthAnchor.constraint(equalTo: heightAnchor).isActive = true
}
override open func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
override open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let model = model as? CircleProgressModel else { return }
createGraphCircle(model)

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class ImageViewModel: MoleculeProtocol {
@objcMembers public class ImageViewModel: MoleculeModelProtocol {
public static var identifier: String = "image"
public var backgroundColor: Color?

View File

@ -219,7 +219,7 @@ public typealias ActionBlock = () -> ()
case left
}
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
clauses = []
guard let labelModel = model as? LabelModel else { return }
attributedText = nil

View File

@ -9,7 +9,7 @@
import Foundation
@objcMembers public class LabelModel: MoleculeProtocol {
@objcMembers public class LabelModel: MoleculeModelProtocol {
public static var identifier: String = "label"
public var moleculeName: String?
public var backgroundColor: Color?

View File

@ -8,7 +8,7 @@
import UIKit
@objcMembers public class LeftRightLabelModel: MoleculeProtocol {
@objcMembers public class LeftRightLabelModel: MoleculeModelProtocol {
public static var identifier: String = "leftRightLabelView"
public var backgroundColor: Color?
public var leftText: LabelModel

View File

@ -179,7 +179,7 @@ import Foundation
//MARK: - MVMCoreMoleculeViewProtocol
open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let leftRightLabelModel = model as? LeftRightLabelModel else {
return

View File

@ -67,7 +67,7 @@ import UIKit
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
}
open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
if let lineModel = model as? LineModel {
setStyle(lineModel.type ?? .standard)
}

View File

@ -8,7 +8,7 @@
import UIKit
@objcMembers public class LineModel: MoleculeProtocol {
@objcMembers public class LineModel: MoleculeModelProtocol {
/*
The frequency of the line in a moleculeList.

View File

@ -209,7 +209,7 @@ import UIKit
}
}
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let imageModel = model as? ImageViewModel else {
return
}

View File

@ -9,7 +9,7 @@
import Foundation
extension MFView {
public func setUpDefaultWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setUpDefaultWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
self.model = model
if let backgroundColor = model?.backgroundColor {
self.backgroundColor = backgroundColor.uiColor
@ -18,7 +18,7 @@ extension MFView {
}
extension ModelMoleculeViewProtocol where Self: MFView {
func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
setUpDefaultWithModel(model, delegateObject, additionalData)
}
}

View File

@ -10,7 +10,7 @@ import Foundation
// temporary until link is finished
extension MVMCoreUISwitch: ModelMoleculeViewProtocol {
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
guard let model = model as? ToggleModel else { return }
if let castSelf = self as? FormValidationProtocol {

View File

@ -64,7 +64,7 @@ import UIKit
}
//MARK: - MVMCoreMoleculeViewProtocol
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let multiProgressModel = multiProgressModel else {
return

View File

@ -18,7 +18,7 @@ import Foundation
}
}
@objcMembers public class MultiProgressBarModel: MoleculeProtocol {
@objcMembers public class MultiProgressBarModel: MoleculeModelProtocol {
public static var identifier: String = "multiProgressBar"
public var progressList: [SingleProgressBarModel]
public var backgroundColor: Color?

View File

@ -51,7 +51,7 @@ import Foundation
}
//MARK: - MVMCoreMoleculeViewProtocol
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let progressBarModel = model as? ProgressBarModel else {
return
}

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class ProgressBarModel: MoleculeProtocol {
@objcMembers public class ProgressBarModel: MoleculeModelProtocol {
public static var identifier: String = "progressbar"
@Percent public var percent: CGFloat
public var progressColor: Color = Color(uiColor: .mfCerulean())

View File

@ -333,7 +333,7 @@ public typealias ActionBlockConfirmation = () -> (Bool)
}
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let toggleModel = model as? ToggleModel else {
return
}

View File

@ -8,7 +8,7 @@
import UIKit
public class ToggleModel: MoleculeProtocol {
public class ToggleModel: MoleculeModelProtocol {
public static var identifier: String = "toggle"
public var moleculeName: String?
public var backgroundColor: Color?

View File

@ -14,7 +14,7 @@ import UIKit
//--------------------------------------------------
public var json: [AnyHashable: Any]?
public var model: MoleculeProtocol?
public var model: MoleculeModelProtocol?
private var initialSetupPerformed = false
@ -49,7 +49,7 @@ import UIKit
}
}
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
self.model = model
if let backgroundColor = model?.backgroundColor {
self.backgroundColor = backgroundColor.uiColor

View File

@ -10,7 +10,7 @@ import UIKit
@objcMembers open class View: UIView, ModelMoleculeViewProtocol {
open var json: [AnyHashable: Any]?
open var model: MoleculeProtocol?
open var model: MoleculeModelProtocol?
private var initialSetupPerformed = false
@ -40,22 +40,22 @@ import UIKit
}
}
open func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
self.model = model
if let backgroundColor = model?.backgroundColor {
self.backgroundColor = backgroundColor.uiColor
}
}
public class func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
public class func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
return model?.moleculeName
}
public class func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return nil
}
public class func requiredModules(_ molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
public class func requiredModules(_ molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
return nil
}
}

View File

@ -16,10 +16,10 @@ extension MFViewController: MoleculeDelegateProtocol {
return loadObject?.modulesJSON?.optionalDictionaryForKey(name)
}
public func getModuleWithName(_ moduleName: String) -> MoleculeProtocol? {
public func getModuleWithName(_ moduleName: String) -> MoleculeModelProtocol? {
guard let moduleJSON = loadObject?.modulesJSON?.optionalDictionaryForKey(moduleName),
let moleculeName = moduleJSON.optionalStringForKey("moleculeName"),
let modelType = ModelRegistry.getType(for: moleculeName) as? MoleculeProtocol.Type else {
let modelType = ModelRegistry.getType(for: moleculeName) as? MoleculeModelProtocol.Type else {
return nil
}
do {

View File

@ -16,7 +16,7 @@ open class Container: View, ContainerProtocol {
}
// MARK:- ModelMoleculeViewProtocol
override open func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
override open func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let containerModel = model as? ContainerModelProtocol else { return }
containerHelper.set(with: containerModel, for: view as? MVMCoreUIViewConstrainingProtocol)

View File

@ -30,7 +30,7 @@ open class MoleculeContainer: Container {
super.setWithJSON(json, delegateObject: delegateObject, additionalData: additionalData)
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
if let casteModel = model as? MoleculeContainerModel {
if view != nil {
(view as? ModelMoleculeViewProtocol)?.setWithModel(casteModel.molecule, delegateObject, additionalData)
@ -43,7 +43,7 @@ open class MoleculeContainer: Container {
super.setWithModel(model, delegateObject, additionalData)
}
public override static func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
public override static func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
guard let containerModel = model as? MoleculeContainerModel,
let moleculeClass = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(containerModel.molecule) as? ModelMoleculeViewProtocol.Type,
let moleculeName = moleculeClass.nameForReuse(containerModel.molecule, delegateObject) else {
@ -52,7 +52,7 @@ open class MoleculeContainer: Container {
return "\(model?.moleculeName ?? "moleculeContainer")<\(moleculeName)>"
}
public override class func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
guard let containerModel = molecule as? MoleculeContainerModel else { return 0 }
guard let moleculeClass = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(containerModel.molecule) as? ModelMoleculeViewProtocol.Type,
let moleculeHeight = moleculeClass.estimatedHeight(forRow: containerModel.molecule, delegateObject: delegateObject) else {
@ -61,7 +61,7 @@ open class MoleculeContainer: Container {
return moleculeHeight + (containerModel.topMarginPadding ?? 0) + (containerModel.bottomMarginPadding ?? 0)
}
public override class func requiredModules(_ molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
public override class func requiredModules(_ molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
guard let containerModel = molecule as? MoleculeContainerModel,
let moleculeClass = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(containerModel.molecule) as? ModelMoleculeViewProtocol.Type else { return nil }
return moleculeClass.requiredModules(containerModel.molecule, delegateObject: delegateObject, error: error)

View File

@ -9,13 +9,13 @@
import Foundation
public class MoleculeContainerModel: ContainerModel {
public var molecule: MoleculeProtocol
public var molecule: MoleculeModelProtocol
private enum CodingKeys: String, CodingKey {
case molecule
}
public init(with moleculeModel: MoleculeProtocol) {
public init(with moleculeModel: MoleculeModelProtocol) {
molecule = moleculeModel
super.init()
}

View File

@ -10,7 +10,7 @@
@import MVMCore.MVMCoreViewProtocol;
@class MVMCoreUIDelegateObject;
@class MVMCoreErrorObject;
@class MoleculeProtocol;
@class MoleculeModelProtocol;
@protocol MVMCoreUIMoleculeViewProtocol <NSObject, MVMCoreViewProtocol>

View File

@ -14,36 +14,36 @@ extension KeyedDecodingContainer where Key : CodingKey {
}
/// Decodes the molecule model with the given coding key based on moleculeName
public func decodeMolecule(codingKey: KeyedDecodingContainer<K>.Key) throws -> MoleculeProtocol {
public func decodeMolecule(codingKey: KeyedDecodingContainer<K>.Key) throws -> MoleculeModelProtocol {
return try decodeModel(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName)
}
/// Decodes the molecule model with the given coding key based on moleculeName, optional
public func decodeMoleculeIfPresent(codingKey: KeyedDecodingContainer<K>.Key) throws -> MoleculeProtocol? {
public func decodeMoleculeIfPresent(codingKey: KeyedDecodingContainer<K>.Key) throws -> MoleculeModelProtocol? {
return try decodeModelIfPresent(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName)
}
/// Decodes the list of molecule models with the given coding key based on moleculeName
public func decodeMolecules(codingKey: KeyedDecodingContainer<K>.Key) throws -> [MoleculeProtocol] {
guard let models = try decodeModels(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName) as? [MoleculeProtocol] else {
public func decodeMolecules(codingKey: KeyedDecodingContainer<K>.Key) throws -> [MoleculeModelProtocol] {
guard let models = try decodeModels(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName) as? [MoleculeModelProtocol] else {
throw ModelRegistry.Error.decoderError
}
return models
}
/// Decodes the list of molecule models with the given coding key based on moleculeName, optional
public func decodeMoleculesIfPresent(codingKey: KeyedDecodingContainer<K>.Key) throws -> [MoleculeProtocol]? {
return try decodeModelsIfPresent(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName) as? [MoleculeProtocol]
public func decodeMoleculesIfPresent(codingKey: KeyedDecodingContainer<K>.Key) throws -> [MoleculeModelProtocol]? {
return try decodeModelsIfPresent(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName) as? [MoleculeModelProtocol]
}
/// Decodes an array with arrays of molecules based on the identifiers, optional.
public func decodeMolecules2DIfPresent(codingKey: KeyedDecodingContainer<K>.Key) throws -> [[MoleculeProtocol]]? {
return try decodeModels2DIfPresent(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName) as? [[MoleculeProtocol]]
public func decodeMolecules2DIfPresent(codingKey: KeyedDecodingContainer<K>.Key) throws -> [[MoleculeModelProtocol]]? {
return try decodeModels2DIfPresent(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName) as? [[MoleculeModelProtocol]]
}
/// Decodes an array with arrays of models based on the identifiers.
public func decodeMolecules2D(codingKey: KeyedDecodingContainer<K>.Key) throws -> [[MoleculeProtocol]] {
guard let models = try decodeModels2D(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName) as? [[MoleculeProtocol]] else {
public func decodeMolecules2D(codingKey: KeyedDecodingContainer<K>.Key) throws -> [[MoleculeModelProtocol]] {
guard let models = try decodeModels2D(codingKey: codingKey, typeCodingKey: TypeCodingKey.moleculeName) as? [[MoleculeModelProtocol]] else {
throw ModelRegistry.Error.decoderError
}
return models

View File

@ -1,5 +1,5 @@
//
// CollectionCellMoleculeProtocol.swift
// CarouselItemModelProtocol.swift
// MVMCoreUI
//
// Created by Suresh, Kamlesh on 11/26/19.
@ -8,7 +8,7 @@
import Foundation
public protocol CollectionCellMoleculeProtocol: ContainerModelProtocol, MoleculeProtocol {
public protocol CarouselItemModelProtocol: ContainerModelProtocol, MoleculeModelProtocol {
var peakingUI: Bool? {get}
var peakingArrowColor: Color? {get}
}

View File

@ -1,5 +1,5 @@
//
// PagingMoleculeProtocol.swift
// CarouselPagingModelProtocol.swift
// MVMCoreUI
//
// Created by Suresh, Kamlesh on 11/25/19.
@ -8,6 +8,6 @@
import Foundation
public protocol PagingMoleculeProtocol: MoleculeProtocol {
public protocol CarouselPagingModelProtocol: MoleculeModelProtocol {
var position: Float? {get}
}

View File

@ -8,7 +8,7 @@
import Foundation
public protocol ListItemModelProtocol: ContainerModelProtocol, MoleculeProtocol {
public protocol ListItemModelProtocol: ContainerModelProtocol, MoleculeModelProtocol {
var line: LineModel? { get set }
var action: ActionProtocol? { get set }
var hideArrow: Bool? { get set }

View File

@ -1,11 +1,11 @@
import Foundation
public protocol MoleculeProtocol: Model {
public protocol MoleculeModelProtocol: Model {
var moleculeName: String? { get }
var backgroundColor: Color? { get set}
}
extension MoleculeProtocol {
extension MoleculeModelProtocol {
public var moleculeName: String? {
get { return Self.identifier }
}

View File

@ -9,7 +9,7 @@
import Foundation
@objcMembers public class CarouselItemModel: MoleculeContainerModel, CollectionCellMoleculeProtocol {
@objcMembers public class CarouselItemModel: MoleculeContainerModel, CarouselItemModelProtocol {
public static var identifier: String = "carouselItem"
public var backgroundColor: Color?
public var peakingUI: Bool?

View File

@ -8,7 +8,7 @@
import UIKit
@objcMembers public class CarouselModel: MoleculeProtocol {
@objcMembers public class CarouselModel: MoleculeModelProtocol {
public static var identifier: String = "carousel"
public var backgroundColor: Color?
public var molecules: [CarouselItemModel]
@ -19,7 +19,7 @@ import UIKit
public var height: Float?
public var itemWidthPercent: Float?
public var itemAlignment: String?
public var pagingMolecule: PagingMoleculeProtocol?
public var pagingMolecule: CarouselPagingModelProtocol?
public init(molecules: [CarouselItemModel]){
self.molecules = molecules
@ -48,7 +48,7 @@ import UIKit
self.height = try typeContainer.decode(Float.self, forKey: .height)
self.itemWidthPercent = try typeContainer.decode(Float.self, forKey: .itemWidthPercent)
self.itemAlignment = try typeContainer.decode(String.self, forKey: .itemAlignment)
self.pagingMolecule = try typeContainer.decodeMoleculeIfPresent(codingKey: .pagingMolecule) as? PagingMoleculeProtocol
self.pagingMolecule = try typeContainer.decodeMoleculeIfPresent(codingKey: .pagingMolecule) as? CarouselPagingModelProtocol
}
public func encode(to encoder: Encoder) throws {

View File

@ -8,7 +8,7 @@
import Foundation
open class ModuleMoleculeModel: MoleculeProtocol {
open class ModuleMoleculeModel: MoleculeModelProtocol {
public var backgroundColor: Color?
public static var identifier: String = "moduleMolecule"
public var moduleName: String

View File

@ -94,7 +94,7 @@ open class DoughnutChart: View {
doughnutLayer.transform = CATransform3DMakeRotation(1 * .pi, 0.0, 0.0, 1.0)
}
open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.setWithModel(model, delegateObject, additionalData)
clearLayers()
guard let doughnutChartModel = doughnutChartModel else {

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class DoughnutChartModel: MoleculeProtocol {
@objcMembers public class DoughnutChartModel: MoleculeModelProtocol {
public var backgroundColor: Color?
public static var identifier: String = "doughnutChart"
public var title: LabelModel?
@ -21,7 +21,7 @@ import Foundation
}
}
@objcMembers public class DoughnutChartItemModel: MoleculeProtocol {
@objcMembers public class DoughnutChartItemModel: MoleculeModelProtocol {
public var backgroundColor: Color?
public static var identifier: String = "doughnutChartItem"
public var label: LabelModel

View File

@ -65,7 +65,7 @@ import Foundation
colorLablesStack.reset()
}
open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let model = doughnutChartModel else { return }
@ -94,7 +94,7 @@ extension DoughnutChartView: MVMCoreUIViewConstrainingProtocol {
}
class ColorViewLabelsStack: MoleculeStackView {
override func createStackItemsFromModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
override func createStackItemsFromModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
guard let stackItemModels = stackModel?.molecules else { return }
for model in stackItemModels {
let view = ColorViewWithLabel()
@ -149,7 +149,7 @@ class ColorViewWithLabel: View {
label.setAsMolecule()
}
override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let chartItemModel = model as? DoughnutChartItemModel else {
return

View File

@ -9,7 +9,7 @@
import Foundation
@objcMembers public class FooterModel: MoleculeContainerModel, MoleculeProtocol {
@objcMembers public class FooterModel: MoleculeContainerModel, MoleculeModelProtocol {
public static var identifier: String = "footer"
public var backgroundColor: Color?
@ -33,7 +33,7 @@ import Foundation
}
}
public override init(with moleculeModel: MoleculeProtocol) {
public override init(with moleculeModel: MoleculeModelProtocol) {
super.init(with: moleculeModel)
setDefaults()
}

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class HeaderModel: MoleculeContainerModel, MoleculeProtocol {
@objcMembers public class HeaderModel: MoleculeContainerModel, MoleculeModelProtocol {
public static var identifier: String = "header"
public var backgroundColor: Color?
public var line: LineModel?
@ -36,7 +36,7 @@ import Foundation
line?.type = .heavy
}
public override init(with moleculeModel: MoleculeProtocol) {
public override init(with moleculeModel: MoleculeModelProtocol) {
super.init(with: moleculeModel)
setDefaults()
}

View File

@ -42,7 +42,7 @@ public class HeaderView: MoleculeContainer {
}
}
open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let headerModel = model as? HeaderModel else {

View File

@ -8,7 +8,7 @@
import UIKit
public class TabsModel: MoleculeProtocol {
public class TabsModel: MoleculeModelProtocol {
public static var identifier: String = "tabs"
public var backgroundColor: Color?
public var tabs: [LabelModel]

View File

@ -303,7 +303,7 @@ extension TwoButtonView {
}
extension TwoButtonView: ModelMoleculeViewProtocol {
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let model = model as? TwoButtonViewModel else { return }
setupUI(primaryButtonShowing: model.primaryButton != nil, secondaryButtonShowing: model.secondaryButton != nil)
setDefaultCustom()

View File

@ -8,7 +8,7 @@
import UIKit
public class TwoButtonViewModel: MoleculeProtocol {
public class TwoButtonViewModel: MoleculeModelProtocol {
public static var identifier: String = "twoButtonView"
public var backgroundColor: Color?
public var primaryButton: ButtonModel?

View File

@ -50,7 +50,7 @@ import UIKit
dropDown?.updateView(size)
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
dropDownListItemModel = model as? DropDownListItemModel
self.delegateObject = delegateObject
super.setWithModel(model, delegateObject, additionalData)

View File

@ -16,7 +16,7 @@ import Foundation
public var line: LineModel? = LineModel(type: .none)
public var hideArrow: Bool? = true
public init(molecule: MoleculeProtocol, molecules: [[ListItemModelProtocol]], dropDown: DropDownModel) {
public init(molecule: MoleculeModelProtocol, molecules: [[ListItemModelProtocol]], dropDown: DropDownModel) {
self.molecules = molecules
self.dropDown = dropDown
super.init(with: molecule)

View File

@ -41,7 +41,7 @@ import MVMCore
}
}
public override init(with moleculeModel: MoleculeProtocol) {
public override init(with moleculeModel: MoleculeModelProtocol) {
super.init(with: moleculeModel)
setDefaults()
}

View File

@ -68,7 +68,7 @@ open class MoleculeCollectionViewCell: UICollectionViewCell, MVMCoreUIMoleculeVi
}
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let collectionModel = model as? CarouselItemModel else {
return
}
@ -114,7 +114,7 @@ open class MoleculeCollectionViewCell: UICollectionViewCell, MVMCoreUIMoleculeVi
backgroundColor = .white
}
public class func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
public class func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
guard let molecule = (model as? CarouselItemModel)?.molecule,
let moleculeClass = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(molecule) as? ModelMoleculeViewProtocol.Type,
let name = moleculeClass.nameForReuse(molecule, delegateObject) ?? molecule.moleculeName else {

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class MoleculeStackItemModel: MoleculeContainerModel, MoleculeProtocol, StackItemModelProtocol {
@objcMembers public class MoleculeStackItemModel: MoleculeContainerModel, MoleculeModelProtocol, StackItemModelProtocol {
public static var identifier: String = "stackItem"
public var backgroundColor: Color?
public var spacing: CGFloat?
@ -21,7 +21,7 @@ import Foundation
case gone
}
public override init(with moleculeModel: MoleculeProtocol) {
public override init(with moleculeModel: MoleculeModelProtocol) {
super.init(with: moleculeModel)
}

View File

@ -11,7 +11,7 @@ import UIKit
@objcMembers open class MoleculeTableViewCell: TableViewCell {
// MARK: - MVMCoreUIMoleculeViewProtocol
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let moleculeModel = (model as? ListItemModel)?.molecule else { return }
if molecule != nil {
@ -21,7 +21,7 @@ import UIKit
}
}
public override class func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
public override class func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
guard let moleculeModel = (model as? ListItemModel)?.molecule else {
return "\(self)<>"
}
@ -38,7 +38,7 @@ import UIKit
return theClass.requiredModules?(moleculeJSON, delegateObject: delegateObject, error: error)
}
public override class func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat {
guard let moleculeModel = (molecule as? MoleculeContainerModel)?.molecule,
let classType = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(moleculeModel) as? ModelMoleculeViewProtocol.Type,
let height = classType.estimatedHeight(forRow: moleculeModel, delegateObject: delegateObject) else {

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class StackItemModel: StackItemModelProtocol, MoleculeProtocol {
@objcMembers public class StackItemModel: StackItemModelProtocol, MoleculeModelProtocol {
public static var identifier: String = "simpleStackItem"
public var backgroundColor: Color?
public var spacing: CGFloat?

View File

@ -8,7 +8,7 @@
import Foundation
public protocol StackItemModelProtocol: MoleculeProtocol {
public protocol StackItemModelProtocol: MoleculeModelProtocol {
var spacing: CGFloat? { get set }
var percent: Int? { get set }
var gone: Bool { get set }

View File

@ -142,7 +142,7 @@ import UIKit
}
//TODO: Model, Change to model
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let model = model as? ListItemModelProtocol else {
return
}
@ -179,11 +179,11 @@ import UIKit
backgroundColor = .white
}
public class func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
public class func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
return model?.moleculeName
}
public class func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return nil
}

View File

@ -38,7 +38,7 @@ import UIKit
// MARK: - MoleculeDelegateProtocol
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
self.delegateObject = delegateObject
tabs.reloadData()

View File

@ -166,7 +166,7 @@ import UIKit
return 34
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let model = model as? CornerLabelsModel else { return }
if middleView != nil {

View File

@ -8,16 +8,16 @@
import UIKit
public class CornerLabelsModel: MoleculeProtocol {
public class CornerLabelsModel: MoleculeModelProtocol {
public static var identifier: String = "cornerLabels"
public var backgroundColor: Color?
public var topLeftLabel: LabelModel?
public var topRightLabel: LabelModel?
public var bottomLeftLabel: LabelModel?
public var bottomRightLabel: LabelModel?
public var molecule: MoleculeProtocol
public var molecule: MoleculeModelProtocol
init(with molecule: MoleculeProtocol) {
init(with molecule: MoleculeModelProtocol) {
self.molecule = molecule
}

View File

@ -37,11 +37,11 @@ import UIKit
//MARK: - MVMCoreMoleculeViewProtocol
open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
}
public class override func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public class override func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return 30
}

View File

@ -41,7 +41,7 @@ import UIKit
mvmSwitch.setWithJSON(json?.optionalDictionaryForKey("toggle"), delegateObject: delegateObject, additionalData: additionalData)
}
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let labelToggleModel = model as? LabelToggleModel else {
return
}

View File

@ -8,7 +8,7 @@
import Foundation
public class LabelToggleModel: MoleculeProtocol {
public class LabelToggleModel: MoleculeModelProtocol {
public static var identifier: String = "labelToggle"
public var backgroundColor: Color?
public var label: LabelModel

View File

@ -9,20 +9,20 @@
import Foundation
public protocol ModelMoleculeViewProtocol {
func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?)
static func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String?
static func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?
static func requiredModules(_ molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]?
func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?)
static func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String?
static func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat?
static func requiredModules(_ molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]?
}
extension ModelMoleculeViewProtocol {
public static func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
public static func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
return model?.moleculeName
}
public static func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public static func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return nil
}
public static func requiredModules(_ molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
public static func requiredModules(_ molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
return nil
}
// Temporary

View File

@ -19,7 +19,7 @@ open class ModuleMolecule: Container {
super.setupView()
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let moduleMoleculeModel = model as? ModuleMoleculeModel,
@ -46,7 +46,7 @@ open class ModuleMolecule: Container {
}
}
public override class func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
guard let moduleMolecule = molecule as? ModuleMoleculeModel,
let moduleModel = delegateObject?.moleculeDelegate?.getModuleWithName(moduleMolecule.moduleName),
@ -58,7 +58,7 @@ open class ModuleMolecule: Container {
return height
}
public override class func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
public override class func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
guard let moduleMolecule = model as? ModuleMoleculeModel,
let moduleModel = delegateObject?.moleculeDelegate?.getModuleWithName(moduleMolecule.moduleName),
let classType = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(moduleModel) as? ModelMoleculeViewProtocol.Type,
@ -69,7 +69,7 @@ open class ModuleMolecule: Container {
return name
}
public override class func requiredModules(_ molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
public override class func requiredModules(_ molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
guard let moduleName = (molecule as? ModuleMoleculeModel)?.moduleName,
let _ = delegateObject?.moleculeDelegate?.getModuleWithName(moduleName) else {

View File

@ -29,7 +29,7 @@ import UIKit
constraint.isActive = true
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
if let casteModel = model as? ScrollerModel {
if view != nil {
(view as? ModelMoleculeViewProtocol)?.setWithModel(casteModel.molecule, delegateObject, additionalData)

View File

@ -8,7 +8,7 @@
import UIKit
public class ScrollerModel: MoleculeContainerModel, MoleculeProtocol {
public class ScrollerModel: MoleculeContainerModel, MoleculeModelProtocol {
public static var identifier: String = "scroller"
public var backgroundColor: Color?
}

View File

@ -8,7 +8,7 @@
import UIKit
struct EyebrowHeadlineBodyLinkModel: MoleculeProtocol {
struct EyebrowHeadlineBodyLinkModel: MoleculeModelProtocol {
static var identifier: String = "eyebrowHeadlineBodyLink"
var backgroundColor: Color?
@ -46,7 +46,7 @@ struct EyebrowHeadlineBodyLinkModel: MoleculeProtocol {
// MARK: - MVMCoreUIMoleculeViewProtocol
open override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
open override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.setWithModel(model, delegateObject, additionalData)
eyebrow.setWithModel(casteModel?.eyeBrow, delegateObject, additionalData)
headline.setWithModel(casteModel?.headline, delegateObject, additionalData)
@ -74,7 +74,7 @@ struct EyebrowHeadlineBodyLinkModel: MoleculeProtocol {
body.styleB2(true)
}
public override class func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return 65
}
}

View File

@ -78,11 +78,11 @@ import Foundation
backgroundImageView.reset()
}
public override class func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return 320
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let model = model as? HeadlineBodyCaretLinkImageModel else { return }
headlineBody.setWithModel(model.headlineBody, delegateObject, additionalData)

View File

@ -119,7 +119,7 @@ open class HeadlineBody: View {
}
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let headlineBodyModel = model as? HeadlineBodyModel else {

View File

@ -8,7 +8,7 @@
import UIKit
public class HeadlineBodyCaretLinkImageModel: MoleculeProtocol {
public class HeadlineBodyCaretLinkImageModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBodyCaretLinkImage"
public var backgroundColor: Color?
public var caretLink: CaretLinkModel?

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class HeadlineBodyModel: MoleculeProtocol {
@objcMembers public class HeadlineBodyModel: MoleculeModelProtocol {
public static var identifier: String = "headlineBody"
public var headline: LabelModel?
public var body: LabelModel?

View File

@ -19,7 +19,7 @@ import Foundation
case list
}
// Numbered list model comes in the from of list = [MoleculeProtocol]
// Numbered list model comes in the from of list = [MoleculeModelProtocol]
public required init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
@ -36,7 +36,7 @@ import Foundation
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
var models: [MoleculeProtocol] = []
var models: [MoleculeModelProtocol] = []
for molecule in molecules {
models.append(molecule.molecule)
}

View File

@ -8,13 +8,13 @@
import Foundation
public class StringAndMoleculeModel: MoleculeProtocol {
public class StringAndMoleculeModel: MoleculeModelProtocol {
public static var identifier: String = "stringAndMoleculeModel"
public var backgroundColor: Color?
public var string: String
public var molecule: MoleculeProtocol
public var molecule: MoleculeModelProtocol
public init(string: String, molecule: MoleculeProtocol) {
public init(string: String, molecule: MoleculeModelProtocol) {
self.string = string
self.molecule = molecule
}

View File

@ -10,7 +10,7 @@ import UIKit
// This class is only temporarily necessary. Eventually we will have initWithModel instad of just init for moleculeviews, which will remove this need.
open class StringAndMoleculeStack: MoleculeStackView {
override func createStackItemsFromModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
override func createStackItemsFromModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
guard let model = stackModel else { return }
for stackItemModel in model.molecules {
guard let stringAndMoleculeModel = stackItemModel.molecule as? StringAndMoleculeModel,

View File

@ -76,7 +76,7 @@ open class StringAndMoleculeView: View {
(molecule as? MoleculeViewProtocol)?.reset?()
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.setWithModel(model, delegateObject, additionalData)
guard let model = model as? StringAndMoleculeModel else { return }
label.text = model.string

View File

@ -21,7 +21,7 @@ import Foundation
case bulletChar
}
// Numbered list model comes in the from of list = [MoleculeProtocol]
// Numbered list model comes in the from of list = [MoleculeModelProtocol]
public required init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
if let bulletChar = try typeContainer.decodeIfPresent(String.self, forKey: .bulletChar) {
@ -42,7 +42,7 @@ import Foundation
try container.encode(bulletChar, forKey: .bulletChar)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
var models: [MoleculeProtocol] = []
var models: [MoleculeModelProtocol] = []
for molecule in molecules {
models.append(molecule.molecule)
}

View File

@ -29,7 +29,7 @@ open class Carousel: ViewConstrainingView, ModelMoleculeViewProtocol {
var numberOfPages = 0
/// The json for the molecules.
var molecules: [MoleculeProtocol]?
var molecules: [MoleculeModelProtocol]?
/// The horizontal alignment of the cell in the collection view. Only noticeable if the itemWidthPercent is less than 100%.
var itemAlignment = UICollectionView.ScrollPosition.left
@ -81,7 +81,7 @@ open class Carousel: ViewConstrainingView, ModelMoleculeViewProtocol {
// MARK: - MVMCoreUIMoleculeViewProtocol
//TODO: Model, Change to model
public func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
public func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
guard let caroselModel = model as? CarouselModel else {
return
}
@ -148,7 +148,7 @@ open class Carousel: ViewConstrainingView, ModelMoleculeViewProtocol {
}
/// Sets up the paging molecule
open func setupPagingMolecule(_ molecule: PagingMoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) {
open func setupPagingMolecule(_ molecule: CarouselPagingModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) {
var pagingView: (UIView & MVMCoreUIPagingProtocol)? = nil
if let molecule = molecule {
pagingView = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(molecule, delegateObject, false) as? (UIView & MVMCoreUIPagingProtocol)
@ -167,7 +167,7 @@ open class Carousel: ViewConstrainingView, ModelMoleculeViewProtocol {
// MARK: - Convenience
/// Returns the (identifier, class) of the molecule for the given map.
func getMoleculeInfo(with molecule: MoleculeProtocol, delegateObject: MVMCoreUIDelegateObject?) -> (identifier: String, class: AnyClass, molecule: MoleculeProtocol)? {
func getMoleculeInfo(with molecule: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject?) -> (identifier: String, class: AnyClass, molecule: MoleculeModelProtocol)? {
guard let className = MVMCoreUIMoleculeMappingObject.shared()?.getMoleculeClass(molecule) ,
let moleculeName = (className as? ModelMoleculeViewProtocol.Type)?.nameForReuse(molecule, delegateObject) ?? molecule.moleculeName else {
return nil

View File

@ -9,7 +9,7 @@
import Foundation
@objcMembers public class MoleculeStackModel: ContainerModel, MoleculeProtocol, StackModelProtocol {
@objcMembers public class MoleculeStackModel: ContainerModel, MoleculeModelProtocol, StackModelProtocol {
public class var identifier: String {
return "stack"
}

View File

@ -23,7 +23,7 @@ open class MoleculeStackView: Stack<MoleculeStackModel> {
// MARK: - Adding to stack
/// Creates all of the stackItems for the stackItemModels
override func createStackItemsFromModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
override func createStackItemsFromModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
guard let stackItemModels = stackModel?.molecules else { return }
for model in stackItemModels {
if let stackItem = MVMCoreUIMoleculeMappingObject.shared()?.createMolecule(model, delegateObject) as? MoleculeStackItem {

View File

@ -88,7 +88,7 @@ open class Stack<T>: Container where T: StackModelProtocol {
}
}
public override func setWithModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
public override func setWithModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
let previousModel = self.model
super.setWithModel(model, delegateObject, additionalData)
removeAllItemViews()
@ -104,7 +104,7 @@ open class Stack<T>: Container where T: StackModelProtocol {
restack()
}
public override class func nameForReuse(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
public override class func nameForReuse(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?) -> String? {
// This will aggregate names of molecules to make an id.
guard let model = model as? T else {
return "stack<>"
@ -125,7 +125,7 @@ open class Stack<T>: Container where T: StackModelProtocol {
}
// Need to update to take into account first spacing flag
public override class func estimatedHeight(forRow molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
public override class func estimatedHeight(forRow molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
guard let model = molecule as? T else { return 0 }
let horizontal = model.axis == .horizontal
var estimatedHeight: CGFloat = 0
@ -144,7 +144,7 @@ open class Stack<T>: Container where T: StackModelProtocol {
return estimatedHeight
}
public override class func requiredModules(_ molecule: MoleculeProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
public override class func requiredModules(_ molecule: MoleculeModelProtocol?, delegateObject: MVMCoreUIDelegateObject?, error: AutoreleasingUnsafeMutablePointer<MVMCoreErrorObject?>?) -> [String]? {
guard let model = molecule as? T else { return nil }
var modules: [String] = []
for case let item in model.molecules {
@ -158,11 +158,11 @@ open class Stack<T>: Container where T: StackModelProtocol {
// MARK: - Subclassables
/// Can be subclassed to create views when we get stack item models and have no views yet
func createStackItemsFromModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
func createStackItemsFromModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
}
/// Can be subclassed to set stack items with model when we already have views
func setStackItemsFromModel(_ model: MoleculeProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
func setStackItemsFromModel(_ model: MoleculeModelProtocol?, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
guard let models = stackModel?.molecules else { return }
for (index, element) in models.enumerated() {
(stackItems[index] as? ModelMoleculeViewProtocol)?.setWithModel(element, delegateObject, additionalData)

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers public class StackModel: StackModelProtocol, MoleculeProtocol {
@objcMembers public class StackModel: StackModelProtocol, MoleculeModelProtocol {
public static var identifier: String = "simpleStack"
public var backgroundColor: Color?
public var molecules: [StackItemModel]

View File

@ -10,18 +10,18 @@ import Foundation
public extension MVMCoreUIMoleculeMappingObject {
func getMoleculeClass(_ model: MoleculeProtocol) -> AnyClass? {
func getMoleculeClass(_ model: MoleculeModelProtocol) -> AnyClass? {
if let moleculeName = model.moleculeName {
return moleculeMapping.object(forKey: moleculeName) as? AnyClass
}
return nil
}
func createMolecule(_ model: MoleculeProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> (UIView & MVMCoreUIMoleculeViewProtocol)? {
func createMolecule(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> (UIView & MVMCoreUIMoleculeViewProtocol)? {
return createMolecule(model, delegateObject, false)
}
func createMolecule(_ model: MoleculeProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ constrainIfNeeded: Bool) -> (UIView & MVMCoreUIMoleculeViewProtocol)? {
func createMolecule(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ constrainIfNeeded: Bool) -> (UIView & MVMCoreUIMoleculeViewProtocol)? {
guard let moleculeName = model.moleculeName,
let molecule = createMolecule(forName: moleculeName) else {
return nil

View File

@ -12,7 +12,7 @@ public protocol MoleculeDelegateProtocol {
/// returns a module for the corresponding module name.
func getModuleWithName(_ name: String?) -> [AnyHashable : Any]?
func getModuleWithName(_ moleculeName: String) -> MoleculeProtocol?
func getModuleWithName(_ moleculeName: String) -> MoleculeModelProtocol?
/// Notifies the delegate that the molecule layout update. Should be called when the layout may change due to an async method.
func moleculeLayoutUpdated(_ molecule: UIView & MVMCoreUIMoleculeViewProtocol) //optional

View File

@ -16,9 +16,9 @@ import Foundation
public var screenHeading: String?
public var isAtomicTabs: Bool?
public var header: MoleculeProtocol?
public var header: MoleculeModelProtocol?
public var molecules: [ListItemModelProtocol]
public var footer: MoleculeProtocol?
public var footer: MoleculeModelProtocol?
public var line: LineModel?
public init(pageType: String, screenHeading: String?, molecules: [ListItemModelProtocol]) {

View File

@ -16,9 +16,9 @@ import Foundation
public var screenHeading: String?
public var isAtomicTabs: Bool?
public var header: MoleculeProtocol?
public var header: MoleculeModelProtocol?
public var moleculeStack: MoleculeStackModel
public var footer: MoleculeProtocol?
public var footer: MoleculeModelProtocol?
public init(pageType: String, moleculeStack: MoleculeStackModel) {
self.pageType = pageType

View File

@ -15,11 +15,11 @@ import Foundation
public var screenHeading: String?
public var isAtomicTabs: Bool?
public var header: MoleculeProtocol?
public var middle: MoleculeProtocol?
public var footer: MoleculeProtocol?
public var header: MoleculeModelProtocol?
public var middle: MoleculeModelProtocol?
public var footer: MoleculeModelProtocol?
public init(pageType: String, header: MoleculeProtocol?, middle: MoleculeProtocol?, footer: MoleculeProtocol?) {
public init(pageType: String, header: MoleculeModelProtocol?, middle: MoleculeModelProtocol?, footer: MoleculeModelProtocol?) {
self.pageType = pageType
self.header = header
self.middle = middle