april jira tasks
This commit is contained in:
parent
cfb2c3c78a
commit
b302d2ff61
@ -61,7 +61,6 @@
|
|||||||
01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB3683236097C0006832FA /* MoleculeModelProtocol.swift */; };
|
01EB3684236097C0006832FA /* MoleculeModelProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB3683236097C0006832FA /* MoleculeModelProtocol.swift */; };
|
||||||
01EB368F23609801006832FA /* LabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368823609801006832FA /* LabelModel.swift */; };
|
01EB368F23609801006832FA /* LabelModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368823609801006832FA /* LabelModel.swift */; };
|
||||||
01EB369023609801006832FA /* MoleculeListItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368923609801006832FA /* MoleculeListItemModel.swift */; };
|
01EB369023609801006832FA /* MoleculeListItemModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368923609801006832FA /* MoleculeListItemModel.swift */; };
|
||||||
01EB369223609801006832FA /* MoleculeStackModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368B23609801006832FA /* MoleculeStackModel.swift */; };
|
|
||||||
01EB369323609801006832FA /* HeaderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368C23609801006832FA /* HeaderModel.swift */; };
|
01EB369323609801006832FA /* HeaderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368C23609801006832FA /* HeaderModel.swift */; };
|
||||||
01EB369423609801006832FA /* HeadlineBodyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368D23609801006832FA /* HeadlineBodyModel.swift */; };
|
01EB369423609801006832FA /* HeadlineBodyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01EB368D23609801006832FA /* HeadlineBodyModel.swift */; };
|
||||||
01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A03123A4498200D954D8 /* CaretLinkModel.swift */; };
|
01F2A03223A4498200D954D8 /* CaretLinkModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F2A03123A4498200D954D8 /* CaretLinkModel.swift */; };
|
||||||
@ -358,7 +357,6 @@
|
|||||||
D29E28D823D21AB800ACEA85 /* StringAndMoleculeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28D723D21AB800ACEA85 /* StringAndMoleculeView.swift */; };
|
D29E28D823D21AB800ACEA85 /* StringAndMoleculeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28D723D21AB800ACEA85 /* StringAndMoleculeView.swift */; };
|
||||||
D29E28DA23D21AFA00ACEA85 /* StringAndMoleculeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28D923D21AFA00ACEA85 /* StringAndMoleculeModel.swift */; };
|
D29E28DA23D21AFA00ACEA85 /* StringAndMoleculeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28D923D21AFA00ACEA85 /* StringAndMoleculeModel.swift */; };
|
||||||
D29E28DD23D7404C00ACEA85 /* ContainerHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */; };
|
D29E28DD23D7404C00ACEA85 /* ContainerHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */; };
|
||||||
D2A5145F2211DDC100345BFB /* MoleculeStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A5145E2211DDC100345BFB /* MoleculeStackView.swift */; };
|
|
||||||
D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */; };
|
D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */; };
|
||||||
D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */; };
|
D2A514632213643100345BFB /* MoleculeStackCenteredTemplate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */; };
|
||||||
D2A514672213885800345BFB /* MoleculeHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514662213885800345BFB /* MoleculeHeaderView.swift */; };
|
D2A514672213885800345BFB /* MoleculeHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2A514662213885800345BFB /* MoleculeHeaderView.swift */; };
|
||||||
@ -460,7 +458,6 @@
|
|||||||
01EB368823609801006832FA /* LabelModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LabelModel.swift; sourceTree = "<group>"; };
|
01EB368823609801006832FA /* LabelModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LabelModel.swift; sourceTree = "<group>"; };
|
||||||
01EB368923609801006832FA /* MoleculeListItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeListItemModel.swift; sourceTree = "<group>"; };
|
01EB368923609801006832FA /* MoleculeListItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeListItemModel.swift; sourceTree = "<group>"; };
|
||||||
01EB368A23609801006832FA /* MoleculeStackItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeStackItemModel.swift; sourceTree = "<group>"; };
|
01EB368A23609801006832FA /* MoleculeStackItemModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeStackItemModel.swift; sourceTree = "<group>"; };
|
||||||
01EB368B23609801006832FA /* MoleculeStackModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoleculeStackModel.swift; sourceTree = "<group>"; };
|
|
||||||
01EB368C23609801006832FA /* HeaderModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeaderModel.swift; sourceTree = "<group>"; };
|
01EB368C23609801006832FA /* HeaderModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeaderModel.swift; sourceTree = "<group>"; };
|
||||||
01EB368D23609801006832FA /* HeadlineBodyModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeadlineBodyModel.swift; sourceTree = "<group>"; };
|
01EB368D23609801006832FA /* HeadlineBodyModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeadlineBodyModel.swift; sourceTree = "<group>"; };
|
||||||
01F2A03123A4498200D954D8 /* CaretLinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaretLinkModel.swift; sourceTree = "<group>"; };
|
01F2A03123A4498200D954D8 /* CaretLinkModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaretLinkModel.swift; sourceTree = "<group>"; };
|
||||||
@ -761,7 +758,6 @@
|
|||||||
D29E28D723D21AB800ACEA85 /* StringAndMoleculeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringAndMoleculeView.swift; sourceTree = "<group>"; };
|
D29E28D723D21AB800ACEA85 /* StringAndMoleculeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringAndMoleculeView.swift; sourceTree = "<group>"; };
|
||||||
D29E28D923D21AFA00ACEA85 /* StringAndMoleculeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringAndMoleculeModel.swift; sourceTree = "<group>"; };
|
D29E28D923D21AFA00ACEA85 /* StringAndMoleculeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringAndMoleculeModel.swift; sourceTree = "<group>"; };
|
||||||
D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContainerHelper.swift; sourceTree = "<group>"; };
|
D29E28DC23D7404C00ACEA85 /* ContainerHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContainerHelper.swift; sourceTree = "<group>"; };
|
||||||
D2A5145E2211DDC100345BFB /* MoleculeStackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackView.swift; sourceTree = "<group>"; };
|
|
||||||
D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackTemplate.swift; sourceTree = "<group>"; };
|
D2A5146022121FBF00345BFB /* MoleculeStackTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackTemplate.swift; sourceTree = "<group>"; };
|
||||||
D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackCenteredTemplate.swift; sourceTree = "<group>"; };
|
D2A514622213643100345BFB /* MoleculeStackCenteredTemplate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeStackCenteredTemplate.swift; sourceTree = "<group>"; };
|
||||||
D2A514662213885800345BFB /* MoleculeHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeHeaderView.swift; sourceTree = "<group>"; };
|
D2A514662213885800345BFB /* MoleculeHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MoleculeHeaderView.swift; sourceTree = "<group>"; };
|
||||||
@ -1185,8 +1181,6 @@
|
|||||||
D260105A23D0BB7100764D80 /* StackModelProtocol.swift */,
|
D260105A23D0BB7100764D80 /* StackModelProtocol.swift */,
|
||||||
D260106423D0CEA700764D80 /* StackModel.swift */,
|
D260106423D0CEA700764D80 /* StackModel.swift */,
|
||||||
D260105C23D0BCD400764D80 /* Stack.swift */,
|
D260105C23D0BCD400764D80 /* Stack.swift */,
|
||||||
01EB368B23609801006832FA /* MoleculeStackModel.swift */,
|
|
||||||
D2A5145E2211DDC100345BFB /* MoleculeStackView.swift */,
|
|
||||||
012A88AE238C626E00FE3DA1 /* CarouselModel.swift */,
|
012A88AE238C626E00FE3DA1 /* CarouselModel.swift */,
|
||||||
D2A6390022CBB1820052ED1F /* Carousel.swift */,
|
D2A6390022CBB1820052ED1F /* Carousel.swift */,
|
||||||
);
|
);
|
||||||
@ -1977,7 +1971,6 @@
|
|||||||
0A21DB91235E0EDB00C160A2 /* DigitBox.swift in Sources */,
|
0A21DB91235E0EDB00C160A2 /* DigitBox.swift in Sources */,
|
||||||
D22D1F572204CE5D0077CEC0 /* MVMCoreUIStackableViewController.m in Sources */,
|
D22D1F572204CE5D0077CEC0 /* MVMCoreUIStackableViewController.m in Sources */,
|
||||||
D28A838B23CCDA6B00DFE4FC /* ButtonModel.swift in Sources */,
|
D28A838B23CCDA6B00DFE4FC /* ButtonModel.swift in Sources */,
|
||||||
D2A5145F2211DDC100345BFB /* MoleculeStackView.swift in Sources */,
|
|
||||||
C7F8012323E846C300396FBD /* ListRVWheelModel.swift in Sources */,
|
C7F8012323E846C300396FBD /* ListRVWheelModel.swift in Sources */,
|
||||||
D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */,
|
D29DF27621E79E81003B2FB9 /* MVMCoreUILoggingHandler.m in Sources */,
|
||||||
C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */,
|
C695A69623C990BC00BFB94E /* DoughnutChart.swift in Sources */,
|
||||||
@ -2003,7 +1996,6 @@
|
|||||||
0A21DB85235E06EF00C160A2 /* MFTextField.m in Sources */,
|
0A21DB85235E06EF00C160A2 /* MFTextField.m in Sources */,
|
||||||
014AA72623C501E2006F3E93 /* ContainerModelProtocol.swift in Sources */,
|
014AA72623C501E2006F3E93 /* ContainerModelProtocol.swift in Sources */,
|
||||||
AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */,
|
AA11A42123F15D7000D7962F /* ListRightVariablePaymentsModel.swift in Sources */,
|
||||||
01EB369223609801006832FA /* MoleculeStackModel.swift in Sources */,
|
|
||||||
011D9626240EBB16000E3791 /* RadioButtonLabelModel.swift in Sources */,
|
011D9626240EBB16000E3791 /* RadioButtonLabelModel.swift in Sources */,
|
||||||
AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */,
|
AAA74A192410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift in Sources */,
|
||||||
D282AABA224131D100C46919 /* MFTransparentGIFView.swift in Sources */,
|
D282AABA224131D100C46919 /* MFTransparentGIFView.swift in Sources */,
|
||||||
|
|||||||
@ -13,5 +13,4 @@ import UIKit
|
|||||||
public var actionType: String
|
public var actionType: String
|
||||||
public var extraParameters: JSONValueDictionary?
|
public var extraParameters: JSONValueDictionary?
|
||||||
public var analyticsData: JSONValueDictionary?
|
public var analyticsData: JSONValueDictionary?
|
||||||
public var title: String?
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,8 +22,6 @@ public class ActionOpenPanelModel: ActionModelProtocol {
|
|||||||
public var panel: Panel
|
public var panel: Panel
|
||||||
public var extraParameters: JSONValueDictionary?
|
public var extraParameters: JSONValueDictionary?
|
||||||
public var analyticsData: JSONValueDictionary?
|
public var analyticsData: JSONValueDictionary?
|
||||||
// Temporary fix till server changes
|
|
||||||
public var title: String?
|
|
||||||
|
|
||||||
public init(panel: Panel) {
|
public init(panel: Panel) {
|
||||||
self.panel = panel
|
self.panel = panel
|
||||||
|
|||||||
@ -14,8 +14,6 @@ import Foundation
|
|||||||
public var pageType: String
|
public var pageType: String
|
||||||
public var extraParameters: JSONValueDictionary?
|
public var extraParameters: JSONValueDictionary?
|
||||||
public var analyticsData: JSONValueDictionary?
|
public var analyticsData: JSONValueDictionary?
|
||||||
// Temporary fix till server changes
|
|
||||||
public var title: String?
|
|
||||||
|
|
||||||
public init(pageType: String) {
|
public init(pageType: String) {
|
||||||
self.pageType = pageType
|
self.pageType = pageType
|
||||||
|
|||||||
@ -37,7 +37,6 @@ import Foundation
|
|||||||
/// Call to register all of the CoreUI molecules.
|
/// Call to register all of the CoreUI molecules.
|
||||||
public static func registerObjects() {
|
public static func registerObjects() {
|
||||||
// Stacks
|
// Stacks
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: MoleculeStackView.self, viewModelClass: MoleculeStackModel.self)
|
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: Stack<StackModel>.self, viewModelClass: StackModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: Stack<StackModel>.self, viewModelClass: StackModel.self)
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: UnOrderedList.self, viewModelClass: UnOrderedListModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: UnOrderedList.self, viewModelClass: UnOrderedListModel.self)
|
||||||
MoleculeObjectMapping.shared()?.register(viewClass: NumberedList.self, viewModelClass: NumberedListModel.self)
|
MoleculeObjectMapping.shared()?.register(viewClass: NumberedList.self, viewModelClass: NumberedListModel.self)
|
||||||
|
|||||||
@ -76,7 +76,7 @@ import Foundation
|
|||||||
for item in model.sections {
|
for item in model.sections {
|
||||||
stackItems.append(MoleculeStackItemModel(with: item))
|
stackItems.append(MoleculeStackItemModel(with: item))
|
||||||
}
|
}
|
||||||
let stack = MoleculeStackModel(molecules: stackItems)
|
let stack = StackModel(molecules: stackItems)
|
||||||
stack.verticalAlignment = .fill
|
stack.verticalAlignment = .fill
|
||||||
colorLablesStack.set(with: stack, delegateObject, additionalData)
|
colorLablesStack.set(with: stack, delegateObject, additionalData)
|
||||||
}
|
}
|
||||||
@ -88,7 +88,7 @@ extension DoughnutChartView: MVMCoreUIViewConstrainingProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class ColorViewLabelsStack: MoleculeStackView {
|
class ColorViewLabelsStack: Stack<StackModel> {
|
||||||
override func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
override func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||||
guard let stackItemModels = stackModel?.molecules else { return }
|
guard let stackItemModels = stackModel?.molecules else { return }
|
||||||
for model in stackItemModels {
|
for model in stackItemModels {
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@objcMembers public class NumberedListModel: MoleculeStackModel {
|
@objcMembers public class NumberedListModel: StackModel {
|
||||||
public override class var identifier: String {
|
public override class var identifier: String {
|
||||||
return "numberedList"
|
return "numberedList"
|
||||||
}
|
}
|
||||||
@ -28,8 +28,7 @@ import Foundation
|
|||||||
for (index, molecule) in list.enumerated() {
|
for (index, molecule) in list.enumerated() {
|
||||||
models.append(MoleculeStackItemModel(with: StringAndMoleculeModel(string: "\(index+1).", molecule: molecule)))
|
models.append(MoleculeStackItemModel(with: StringAndMoleculeModel(string: "\(index+1).", molecule: molecule)))
|
||||||
}
|
}
|
||||||
super.init(molecules: models)
|
super.init(molecules: models, spacing: 0)
|
||||||
spacing = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func encode(to encoder: Encoder) throws {
|
public override func encode(to encoder: Encoder) throws {
|
||||||
@ -39,9 +38,9 @@ import Foundation
|
|||||||
|
|
||||||
var models: [MoleculeModelProtocol] = []
|
var models: [MoleculeModelProtocol] = []
|
||||||
for molecule in molecules {
|
for molecule in molecules {
|
||||||
models.append(molecule.molecule)
|
models.append((molecule as! MoleculeStackItemModel).molecule)
|
||||||
}
|
}
|
||||||
try container.encodeModels(models, forKey: .list)
|
try container.encodeModels(molecules, forKey: .list)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,10 +9,11 @@
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
// This class is only temporarily necessary. Eventually we will have initWithModel instad of just init for moleculeviews, which will remove this need.
|
// 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 {
|
open class StringAndMoleculeStack: Stack<StackModel> {
|
||||||
override open func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
override open func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
||||||
guard let model = stackModel else { return }
|
guard let model = model as? StackModelProtocol,
|
||||||
for stackItemModel in model.molecules {
|
let molcules = model.molecules as? [MoleculeStackItemModel] else { return }
|
||||||
|
for stackItemModel in molcules {
|
||||||
guard let stringAndMoleculeModel = stackItemModel.molecule as? StringAndMoleculeModel,
|
guard let stringAndMoleculeModel = stackItemModel.molecule as? StringAndMoleculeModel,
|
||||||
let molecule = MoleculeObjectMapping.shared()?.createMolecule(stringAndMoleculeModel.molecule, delegateObject: delegateObject
|
let molecule = MoleculeObjectMapping.shared()?.createMolecule(stringAndMoleculeModel.molecule, delegateObject: delegateObject
|
||||||
, additionalData: additionalData) else {
|
, additionalData: additionalData) else {
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import Foundation
|
|||||||
|
|
||||||
open class StringAndMoleculeView: View {
|
open class StringAndMoleculeView: View {
|
||||||
var label = Label.commonLabelB2(true)
|
var label = Label.commonLabelB2(true)
|
||||||
var string: String
|
|
||||||
var molecule: MoleculeViewProtocol
|
var molecule: MoleculeViewProtocol
|
||||||
|
|
||||||
var leftWidthConstraint: NSLayoutConstraint?
|
var leftWidthConstraint: NSLayoutConstraint?
|
||||||
@ -28,7 +27,7 @@ open class StringAndMoleculeView: View {
|
|||||||
|
|
||||||
// MARK: - Inits
|
// MARK: - Inits
|
||||||
public init(string: String, molecule: MoleculeViewProtocol) {
|
public init(string: String, molecule: MoleculeViewProtocol) {
|
||||||
self.string = string
|
self.label.text = string
|
||||||
self.molecule = molecule
|
self.molecule = molecule
|
||||||
super.init(frame: .zero)
|
super.init(frame: .zero)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@objcMembers public class UnOrderedListModel: MoleculeStackModel {
|
@objcMembers public class UnOrderedListModel: StackModel {
|
||||||
public override class var identifier: String {
|
public override class var identifier: String {
|
||||||
return "unOrderedList"
|
return "unOrderedList"
|
||||||
}
|
}
|
||||||
@ -33,8 +33,7 @@ import Foundation
|
|||||||
for molecule in list {
|
for molecule in list {
|
||||||
models.append(MoleculeStackItemModel(with: StringAndMoleculeModel(string: bulletChar, molecule: molecule)))
|
models.append(MoleculeStackItemModel(with: StringAndMoleculeModel(string: bulletChar, molecule: molecule)))
|
||||||
}
|
}
|
||||||
super.init(molecules: models)
|
super.init(molecules: models, spacing: 0)
|
||||||
spacing = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override func encode(to encoder: Encoder) throws {
|
public override func encode(to encoder: Encoder) throws {
|
||||||
@ -45,7 +44,7 @@ import Foundation
|
|||||||
|
|
||||||
var models: [MoleculeModelProtocol] = []
|
var models: [MoleculeModelProtocol] = []
|
||||||
for molecule in molecules {
|
for molecule in molecules {
|
||||||
models.append(molecule.molecule)
|
models.append((molecule as! MoleculeStackItemModel).molecule)
|
||||||
}
|
}
|
||||||
try container.encodeModels(models, forKey: .list)
|
try container.encodeModels(models, forKey: .list)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,54 +0,0 @@
|
|||||||
//
|
|
||||||
// MoleculeStack.swift
|
|
||||||
// MVMCoreUI
|
|
||||||
//
|
|
||||||
// Created by Suresh, Kamlesh on 10/3/19.
|
|
||||||
// Copyright © 2019 Suresh, Kamlesh. All rights reserved.
|
|
||||||
//
|
|
||||||
// A stack that has a list molecule stack items.
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
|
|
||||||
@objcMembers public class MoleculeStackModel: ContainerModel, MoleculeModelProtocol, StackModelProtocol {
|
|
||||||
public class var identifier: String {
|
|
||||||
return "stack"
|
|
||||||
}
|
|
||||||
public var backgroundColor: Color?
|
|
||||||
public var molecules: [MoleculeStackItemModel]
|
|
||||||
public var axis: NSLayoutConstraint.Axis = .vertical
|
|
||||||
public var spacing: CGFloat = 16.0
|
|
||||||
public var useStackSpacingBeforeFirstItem = false
|
|
||||||
|
|
||||||
public init(molecules: [MoleculeStackItemModel]) {
|
|
||||||
self.molecules = molecules
|
|
||||||
super.init()
|
|
||||||
}
|
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
|
||||||
case moleculeName
|
|
||||||
case molecules
|
|
||||||
case axis
|
|
||||||
case spacing
|
|
||||||
}
|
|
||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
|
||||||
molecules = try typeContainer.decode([MoleculeStackItemModel].self, forKey: .molecules)
|
|
||||||
if let axisString = try typeContainer.decodeIfPresent(String.self, forKey: .axis), let optionalAxis = NSLayoutConstraint.Axis(rawValue: axisString) {
|
|
||||||
axis = optionalAxis
|
|
||||||
}
|
|
||||||
if let spacing = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .spacing) {
|
|
||||||
self.spacing = spacing
|
|
||||||
}
|
|
||||||
try super.init(from: decoder)
|
|
||||||
}
|
|
||||||
|
|
||||||
public override func encode(to encoder: Encoder) throws {
|
|
||||||
try super.encode(to: encoder)
|
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
||||||
try container.encode(moleculeName, forKey: .moleculeName)
|
|
||||||
try container.encodeIfPresent(molecules, forKey: .molecules)
|
|
||||||
try container.encodeIfPresent(axis.rawValueString, forKey: .axis)
|
|
||||||
try container.encodeIfPresent(spacing, forKey: .spacing)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
//
|
|
||||||
// MoleculeStackView.swift
|
|
||||||
// MVMCoreUI
|
|
||||||
//
|
|
||||||
// Created by Scott Pfeil on 2/11/19.
|
|
||||||
// Copyright © 2019 Verizon Wireless. All rights reserved.
|
|
||||||
//
|
|
||||||
|
|
||||||
import UIKit
|
|
||||||
|
|
||||||
open class MoleculeStackView: Stack<MoleculeStackModel> {
|
|
||||||
open override var stackModel: MoleculeStackModel? {
|
|
||||||
get { return model as? MoleculeStackModel }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Convenience function, adds a molecule to a MoleculeStackItem to the MoleculeStack
|
|
||||||
func setup(with views: [View], lastItem: Bool) {
|
|
||||||
var models: [MoleculeStackItemModel] = []
|
|
||||||
for view in views {
|
|
||||||
guard let model = view.model else { return }
|
|
||||||
let stackItemModel = MoleculeStackItemModel(with: model)
|
|
||||||
let stackItem = MoleculeStackItem(andContain: view)
|
|
||||||
stackItems.append(stackItem)
|
|
||||||
models.append(stackItemModel)
|
|
||||||
}
|
|
||||||
if let stackModel = stackModel {
|
|
||||||
stackModel.molecules = models
|
|
||||||
} else {
|
|
||||||
model = MoleculeStackModel(molecules: models)
|
|
||||||
}
|
|
||||||
restack()
|
|
||||||
}
|
|
||||||
|
|
||||||
// MARK: - Adding to stack
|
|
||||||
/// Creates all of the stackItems for the stackItemModels
|
|
||||||
override open func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
|
|
||||||
guard let stackItemModels = stackModel?.molecules else { return }
|
|
||||||
for model in stackItemModels {
|
|
||||||
if let stackItem = MoleculeObjectMapping.shared()?.createMolecule(model, delegateObject: delegateObject, additionalData: additionalData) as? MoleculeStackItem {
|
|
||||||
stackItems.append(stackItem)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -217,7 +217,14 @@ open class Stack<T>: Container where T: (StackModelProtocol & MoleculeModelProto
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|
||||||
/// Can be subclassed to create views when we get stack item models and have no views yet
|
/// Can be subclassed to create views when we get stack item models and have no views yet
|
||||||
open func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) { }
|
open func createStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
|
guard let stackItemModels = (model as? StackModelProtocol)?.molecules else { return }
|
||||||
|
for model in stackItemModels {
|
||||||
|
if let stackItem = MoleculeObjectMapping.shared()?.createMolecule(model, delegateObject: delegateObject, additionalData: additionalData) as? (MoleculeViewProtocol & StackModelProtocol) {
|
||||||
|
stackItems.append(stackItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Can be subclassed to set stack items with model when we already have views
|
/// Can be subclassed to set stack items with model when we already have views
|
||||||
open func setStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
open func setStackItemsFromModel(_ model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable: Any]?) {
|
||||||
@ -243,10 +250,10 @@ open class Stack<T>: Container where T: (StackModelProtocol & MoleculeModelProto
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Sets the stack with StackItems containing the passed in views and sets the StackModel with models.
|
/// Sets the stack with StackItems containing the passed in views and sets the StackModel with models.
|
||||||
open func set(with viewModels:[(view: UIView, model: T.AnyStackItemModel)]) {
|
open func set(with viewModels:[(view: UIView, model: StackItemModel)]) {
|
||||||
guard var stackModel = self.stackModel else { return }
|
guard var stackModel = self.stackModel else { return }
|
||||||
var stackItems: [StackItem] = []
|
var stackItems: [StackItem] = []
|
||||||
var models: [T.AnyStackItemModel] = []
|
var models: [StackItemModel] = []
|
||||||
for item in viewModels {
|
for item in viewModels {
|
||||||
stackItems.append(StackItem(andContain: item.view))
|
stackItems.append(StackItem(andContain: item.view))
|
||||||
models.append(item.model)
|
models.append(item.model)
|
||||||
|
|||||||
@ -8,17 +8,19 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@objcMembers public class StackModel: StackModelProtocol, MoleculeModelProtocol {
|
@objcMembers public class StackModel: ContainerModel, StackModelProtocol, MoleculeModelProtocol {
|
||||||
static let defaultSpacing: CGFloat = 16.0
|
static let defaultSpacing: CGFloat = 16.0
|
||||||
|
|
||||||
public static var identifier: String = "simpleStack"
|
public class var identifier: String {
|
||||||
|
return "stack"
|
||||||
|
}
|
||||||
public var backgroundColor: Color?
|
public var backgroundColor: Color?
|
||||||
public var molecules: [StackItemModel]
|
public var molecules: [StackItemModelProtocol]
|
||||||
public var axis: NSLayoutConstraint.Axis = .vertical
|
public var axis: NSLayoutConstraint.Axis = .vertical
|
||||||
public var spacing: CGFloat = StackModel.defaultSpacing
|
public var spacing: CGFloat = StackModel.defaultSpacing
|
||||||
public var useStackSpacingBeforeFirstItem = false
|
public var useStackSpacingBeforeFirstItem = false
|
||||||
|
|
||||||
public init(molecules: [StackItemModel], axis: NSLayoutConstraint.Axis? = nil, spacing: CGFloat? = nil) {
|
public init(molecules: [StackItemModelProtocol], axis: NSLayoutConstraint.Axis? = nil, spacing: CGFloat? = nil) {
|
||||||
self.molecules = molecules
|
self.molecules = molecules
|
||||||
if let axis = axis {
|
if let axis = axis {
|
||||||
self.axis = axis
|
self.axis = axis
|
||||||
@ -26,6 +28,7 @@ import Foundation
|
|||||||
if let spacing = spacing {
|
if let spacing = spacing {
|
||||||
self.spacing = spacing
|
self.spacing = spacing
|
||||||
}
|
}
|
||||||
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
private enum CodingKeys: String, CodingKey {
|
private enum CodingKeys: String, CodingKey {
|
||||||
@ -38,19 +41,20 @@ import Foundation
|
|||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
|
molecules = try typeContainer.decodeModel(codingKey: .molecules)
|
||||||
molecules = try typeContainer.decode([StackItemModel].self, forKey: .molecules)
|
|
||||||
if let axisString = try typeContainer.decodeIfPresent(String.self, forKey: .axis), let optionalAxis = NSLayoutConstraint.Axis(rawValue: axisString) {
|
if let axisString = try typeContainer.decodeIfPresent(String.self, forKey: .axis), let optionalAxis = NSLayoutConstraint.Axis(rawValue: axisString) {
|
||||||
axis = optionalAxis
|
axis = optionalAxis
|
||||||
}
|
}
|
||||||
if let spacing = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .spacing) {
|
if let spacing = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .spacing) {
|
||||||
self.spacing = spacing
|
self.spacing = spacing
|
||||||
}
|
}
|
||||||
|
try super.init(from: decoder)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func encode(to encoder: Encoder) throws {
|
public override func encode(to encoder: Encoder) throws {
|
||||||
|
try super.encode(to: encoder)
|
||||||
var container = encoder.container(keyedBy: CodingKeys.self)
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
||||||
try container.encodeIfPresent(molecules, forKey: .molecules)
|
try container.encodeModels(molecules, forKey: .molecules)
|
||||||
try container.encodeIfPresent(axis.rawValueString, forKey: .axis)
|
try container.encodeIfPresent(axis.rawValueString, forKey: .axis)
|
||||||
try container.encodeIfPresent(spacing, forKey: .spacing)
|
try container.encodeIfPresent(spacing, forKey: .spacing)
|
||||||
try container.encode(moleculeName, forKey: .moleculeName)
|
try container.encode(moleculeName, forKey: .moleculeName)
|
||||||
|
|||||||
@ -9,9 +9,7 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
public protocol StackModelProtocol {
|
public protocol StackModelProtocol {
|
||||||
associatedtype AnyStackItemModel: StackItemModelProtocol
|
var molecules: [StackItemModelProtocol] { get set }
|
||||||
|
|
||||||
var molecules: [AnyStackItemModel] { get set }
|
|
||||||
var axis: NSLayoutConstraint.Axis { get set }
|
var axis: NSLayoutConstraint.Axis { get set }
|
||||||
var spacing: CGFloat { get set }
|
var spacing: CGFloat { get set }
|
||||||
var useStackSpacingBeforeFirstItem: Bool { get set }
|
var useStackSpacingBeforeFirstItem: Bool { get set }
|
||||||
|
|||||||
@ -49,7 +49,7 @@ open class MoleculeStackTemplate: ThreeLayerViewController, TemplateProtocol {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
let stack = MoleculeStackView(frame: .zero)
|
let stack = Stack<StackModel>(frame: .zero)
|
||||||
moleculeStackModel.useStackSpacingBeforeFirstItem = true
|
moleculeStackModel.useStackSpacingBeforeFirstItem = true
|
||||||
moleculeStackModel.useHorizontalMargins = true
|
moleculeStackModel.useHorizontalMargins = true
|
||||||
stack.set(with: moleculeStackModel, delegateObject() as? MVMCoreUIDelegateObject, nil)
|
stack.set(with: moleculeStackModel, delegateObject() as? MVMCoreUIDelegateObject, nil)
|
||||||
|
|||||||
@ -15,10 +15,10 @@ import Foundation
|
|||||||
}
|
}
|
||||||
|
|
||||||
public var header: MoleculeModelProtocol?
|
public var header: MoleculeModelProtocol?
|
||||||
public var moleculeStack: MoleculeStackModel
|
public var moleculeStack: StackModel
|
||||||
public var footer: MoleculeModelProtocol?
|
public var footer: MoleculeModelProtocol?
|
||||||
|
|
||||||
public init(pageType: String, moleculeStack: MoleculeStackModel) {
|
public init(pageType: String, moleculeStack: StackModel) {
|
||||||
self.moleculeStack = moleculeStack
|
self.moleculeStack = moleculeStack
|
||||||
super.init(pageType: pageType)
|
super.init(pageType: pageType)
|
||||||
}
|
}
|
||||||
@ -31,7 +31,7 @@ import Foundation
|
|||||||
|
|
||||||
required public init(from decoder: Decoder) throws {
|
required public init(from decoder: Decoder) throws {
|
||||||
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
moleculeStack = try typeContainer.decode(MoleculeStackModel.self, forKey: .stack)
|
moleculeStack = try typeContainer.decode(StackModel.self, forKey: .stack)
|
||||||
header = try typeContainer.decodeModelIfPresent(codingKey: .header)
|
header = try typeContainer.decodeModelIfPresent(codingKey: .header)
|
||||||
footer = try typeContainer.decodeModelIfPresent(codingKey: .footer)
|
footer = try typeContainer.decodeModelIfPresent(codingKey: .footer)
|
||||||
try super.init(from: decoder)
|
try super.init(from: decoder)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user