This commit is contained in:
Suresh, Kamlesh 2019-11-27 17:25:23 -05:00
parent 7a09e4b830
commit 0648ec0191
6 changed files with 73 additions and 8 deletions

View File

@ -21,6 +21,7 @@
012A88C8238DB02000FE3DA1 /* ModelMoleculeDelegateProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88C7238DB02000FE3DA1 /* ModelMoleculeDelegateProtocol.swift */; };
012A88DA238ED42E00FE3DA1 /* StackPageTemplateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012CA9DF23888AC8003F810F /* StackPageTemplateModel.swift */; };
012A88DB238ED45900FE3DA1 /* CarouselModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88AE238C626E00FE3DA1 /* CarouselModel.swift */; };
012A88EC238F084D00FE3DA1 /* FooterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012A88EB238F084D00FE3DA1 /* FooterModel.swift */; };
012CA98923849699003F810F /* SeperatorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012CA98823849699003F810F /* SeperatorModel.swift */; };
012CA99A2384A687003F810F /* MFTextField+ModelExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012CA9992384A687003F810F /* MFTextField+ModelExtension.swift */; };
012CA99C23859FDC003F810F /* ViewConstrainingView+ModelExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 012CA99B23859FDC003F810F /* ViewConstrainingView+ModelExtension.swift */; };
@ -263,6 +264,7 @@
012A88C3238D86E600FE3DA1 /* CollectionCellMoleculeProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CollectionCellMoleculeProtocol.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>"; };
012CA98823849699003F810F /* SeperatorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeperatorModel.swift; sourceTree = "<group>"; };
012CA9992384A687003F810F /* MFTextField+ModelExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MFTextField+ModelExtension.swift"; sourceTree = "<group>"; };
012CA99B23859FDC003F810F /* ViewConstrainingView+ModelExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ViewConstrainingView+ModelExtension.swift"; sourceTree = "<group>"; };
@ -556,6 +558,7 @@
01EB368A23609801006832FA /* MoleculeStackItemModel.swift */,
01EB368B23609801006832FA /* MoleculeStackModel.swift */,
01EB368C23609801006832FA /* HeaderModel.swift */,
012A88EB238F084D00FE3DA1 /* FooterModel.swift */,
01EB368D23609801006832FA /* HeadlineBodyModel.swift */,
017BEB3F23620A230024EF95 /* TextFieldModel.swift */,
017BEB4123620AD20024EF95 /* FormModelProtocol.swift */,
@ -1301,6 +1304,7 @@
D282AABA224131D100C46919 /* MFTransparentGIFView.swift in Sources */,
944589232385DA9600DE9FD4 /* ImageViewModel.swift in Sources */,
D213347723843825008E41B3 /* Line.swift in Sources */,
012A88EC238F084D00FE3DA1 /* FooterModel.swift in Sources */,
D2A514672213885800345BFB /* StandardHeaderView.swift in Sources */,
01EB369023609801006832FA /* ListItemModel.swift in Sources */,
D268C70C2386DFFD007F2C1C /* MoleculeStackItemModel.swift in Sources */,

View File

@ -0,0 +1,44 @@
//
// FooterModel.swift
// MVMCoreUI
//
// Created by Suresh, Kamlesh on 11/27/19.
// Copyright © 2019 Verizon Wireless. All rights reserved.
//
import Foundation
@objcMembers public class FooterModel: ConstrainingMoleculeProtocol {
public static var identifier: String = "footer"
public var moleculeName: String?
public var backgroundColor: String?
public var molecule: MoleculeProtocol?
public init(molecule: MoleculeProtocol?, backgroundColor: String?){
self.molecule = molecule
self.moleculeName = Self.identifier
self.backgroundColor = backgroundColor
}
enum CodingKeys: String, CodingKey {
case moleculeName
case molecule
case backgroundColor
case separator
}
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
self.moleculeName = try typeContainer.decode(String.self, forKey: .moleculeName)
self.backgroundColor = try typeContainer.decodeIfPresent(String.self, forKey: .backgroundColor)
self.molecule = try typeContainer.decodeIfPresent(codingKey: .molecule)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(self.molecule, forKey: .molecule)
try container.encodeIfPresent(self.backgroundColor, forKey: .backgroundColor)
}
}

View File

@ -13,9 +13,9 @@ import Foundation
public var moleculeName: String?
public var backgroundColor: String?
public var molecule: MoleculeProtocol?
public var seperator: MoleculeProtocol?
public var seperator: SeperatorModel?
public init(molecule: MoleculeProtocol?, backgroundColor: String?, seperator: MoleculeProtocol?){
public init(molecule: MoleculeProtocol?, backgroundColor: String?, seperator: SeperatorModel?){
self.molecule = molecule
self.moleculeName = Self.identifier
self.backgroundColor = backgroundColor
@ -32,16 +32,16 @@ import Foundation
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
self.moleculeName = try typeContainer.decode(String.self, forKey: .moleculeName)
self.backgroundColor = try typeContainer.decode(String.self, forKey: .backgroundColor)
self.backgroundColor = try typeContainer.decodeIfPresent(String.self, forKey: .backgroundColor)
self.molecule = try typeContainer.decodeIfPresent(codingKey: .molecule)
self.seperator = try typeContainer.decodeIfPresent(codingKey: .separator)
self.seperator = try typeContainer.decodeIfPresent(SeperatorModel.self, forKey: .separator)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(self.molecule, forKey: .molecule)
try container.encode(backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(self.backgroundColor, forKey: .backgroundColor)
try container.encodeIfPresent(self.seperator, forKey: .separator)
}
}

View File

@ -17,5 +17,22 @@ import Foundation
self.headline = headline
self.moleculeName = Self.identifier
}
enum CodingKeys: String, CodingKey {
case moleculeName
case headline
}
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
self.moleculeName = try typeContainer.decode(String.self, forKey: .moleculeName)
self.headline = try typeContainer.decodeIfPresent(LabelModel.self, forKey: .headline)
}
public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(self.headline, forKey: .headline)
}
}

View File

@ -10,5 +10,5 @@ import UIKit
@objcMembers public class SeperatorModel: MoleculeProtocol {
public static var identifier: String = "line"
public var type: String?
public var type: String
}

View File

@ -18,7 +18,7 @@ import Foundation
public var isAtomicTabs: Bool?
public var header: MoleculeStackModel?
public var header: HeaderModel?
public var moleculeStack: MoleculeStackModel?
public var footer: MoleculeStackModel?
public var footer: FooterModel?
}