Merge branch 'feature/headers_H1_button' into 'develop'

Feature/headers h1 button

See merge request BPHV_MIPS/mvm_core_ui!494
This commit is contained in:
Pfeil, Scott Robert 2020-06-23 11:07:27 -04:00
commit 3e565fe194
10 changed files with 144 additions and 6 deletions

View File

@ -189,6 +189,8 @@
94F6516D2437954100631BF9 /* Tabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 94F6516C2437954100631BF9 /* Tabs.swift */; };
AA0A257824766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */; };
AA0A257A24766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */; };
AA104AC724472DB0004D2810 /* HeadersH1Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC624472DB0004D2810 /* HeadersH1Button.swift */; };
AA104AC924472DC7004D2810 /* HeadersH1ButtonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */; };
AA104B1A24474A66004D2810 /* HeadersH2Buttons.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */; };
AA104B1C24474A76004D2810 /* HeadersH2ButtonsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */; };
AA11A41F23F15D3100D7962F /* ListRightVariablePayments.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */; };
@ -637,6 +639,8 @@
94F6516C2437954100631BF9 /* Tabs.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Tabs.swift; sourceTree = "<group>"; };
AA0A257724766C8A00862F64 /* ListLeftVariableIconWithRightCaretBodyTextModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyTextModel.swift; sourceTree = "<group>"; };
AA0A257924766CA200862F64 /* ListLeftVariableIconWithRightCaretBodyText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListLeftVariableIconWithRightCaretBodyText.swift; sourceTree = "<group>"; };
AA104AC624472DB0004D2810 /* HeadersH1Button.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1Button.swift; sourceTree = "<group>"; };
AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH1ButtonModel.swift; sourceTree = "<group>"; };
AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2Buttons.swift; sourceTree = "<group>"; };
AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadersH2ButtonsModel.swift; sourceTree = "<group>"; };
AA11A41E23F15D3100D7962F /* ListRightVariablePayments.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListRightVariablePayments.swift; sourceTree = "<group>"; };
@ -1038,12 +1042,8 @@
5206F150241144A900658DC5 /* Headers */ = {
isa = PBXGroup;
children = (
AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */,
AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */,
AA26850D244840C300CE34CC /* HeadersH2TinyButtonModel.swift */,
AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */,
AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */,
AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */,
D287955224A2504C0056BF75 /* H1 */,
D287955324A250550056BF75 /* H2 */,
);
path = Headers;
sourceTree = "<group>";
@ -1489,6 +1489,28 @@
path = Selectors;
sourceTree = "<group>";
};
D287955224A2504C0056BF75 /* H1 */ = {
isa = PBXGroup;
children = (
AA104AC824472DC7004D2810 /* HeadersH1ButtonModel.swift */,
AA104AC624472DB0004D2810 /* HeadersH1Button.swift */,
);
path = H1;
sourceTree = "<group>";
};
D287955324A250550056BF75 /* H2 */ = {
isa = PBXGroup;
children = (
AAA74A182410C05800080241 /* HeadersH2NoButtonsBodyTextModel.swift */,
AAA74A162410C04600080241 /* HeadersH2NoButtonsBodyText.swift */,
AA26850D244840C300CE34CC /* HeadersH2TinyButtonModel.swift */,
AA26850B244840AE00CE34CC /* HeadersH2TinyButton.swift */,
AA104B1B24474A76004D2810 /* HeadersH2ButtonsModel.swift */,
AA104B1924474A66004D2810 /* HeadersH2Buttons.swift */,
);
path = H2;
sourceTree = "<group>";
};
D29DF0C221E404D4003B2FB9 = {
isa = PBXGroup;
children = (
@ -2326,6 +2348,7 @@
AA7F32AB246C0F7900C965BA /* ListLeftVariableRadioButtonAllTextAndLinksModel.swift in Sources */,
8D084AD02410BF4800951227 /* ListOneColumnFullWidthTextBodyTextModel.swift in Sources */,
D253BB9E2458751F002DE544 /* BGImageMoleculeModel.swift in Sources */,
AA104AC924472DC7004D2810 /* HeadersH1ButtonModel.swift in Sources */,
0ABD1371237DB0450081388D /* ItemDropdownEntryField.swift in Sources */,
8D24041123E7FB9E009E23BE /* ListLeftVariableIconWithRightCaret.swift in Sources */,
BB2FB3BD247E7EF200DF73CD /* Tags.swift in Sources */,
@ -2394,6 +2417,7 @@
BB54C5202434D92F0038326C /* ListRightVariableButtonAllTextAndLinks.swift in Sources */,
948DB67E2326DCD90011F916 /* MultiProgress.swift in Sources */,
013F801923FB4A8E00AD8013 /* UIContentMode+Extension.swift in Sources */,
AA104AC724472DB0004D2810 /* HeadersH1Button.swift in Sources */,
525239C22407BD1000454969 /* ListTwoColumnPriceDetails.swift in Sources */,
AA997252247530B100FC7472 /* ListLeftVariableIconAllTextLinks.swift in Sources */,
D2A5146122121FBF00345BFB /* MoleculeStackTemplate.swift in Sources */,

View File

@ -204,6 +204,7 @@ import Foundation
MoleculeObjectMapping.shared()?.register(viewClass: ListThreeColumnDataUsageDivider.self, viewModelClass: ListThreeColumnDataUsageDividerModel.self)
// Designed Headers
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH1Button.self, viewModelClass: HeadersH1ButtonModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2TinyButton.self, viewModelClass: HeadersH2TinyButtonModel.self)
MoleculeObjectMapping.shared()?.register(viewClass: HeadersH2Buttons.self, viewModelClass: HeadersH2ButtonsModel.self)

View File

@ -0,0 +1,59 @@
//
// HeadersH1Button.swift
// MVMCoreUI
//
// Created by Lekshmi S on 04/03/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
@objcMembers open class HeadersH1Button: HeaderView {
//--------------------------------------------------
// MARK: - Outlets
//--------------------------------------------------
public let headlineBody = HeadlineBody(frame: .zero)
public let buttons = TwoButtonView(frame: .zero)
public let stack: Stack<StackModel>
//-------------------------------------------------------
// MARK: - Initializers
//-------------------------------------------------------
public override init(frame: CGRect) {
stack = Stack<StackModel>.createStack(with: [headlineBody, buttons], spacing: Padding.Eighteen)
super.init(frame: frame)
}
public required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
//-------------------------------------------------------
// MARK: - View Lifecycle
//-------------------------------------------------------
open override func setupView() {
super.setupView()
headlineBody.styleLandingPageHeader()
addMolecule(stack)
stack.restack()
}
//----------------------------------------------------
// MARK: - Molecule
//------------------------------------------------------
open override func set(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?, _ additionalData: [AnyHashable : Any]?) {
super.set(with: model, delegateObject, additionalData)
guard let model = model as? HeadersH1ButtonModel else { return }
headlineBody.set(with: model.headlineBody, delegateObject, additionalData)
buttons.set(with: model.buttons, delegateObject, additionalData)
}
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return 121
}
open override func reset() {
super.reset()
headlineBody.styleLandingPageHeader()
}
}

View File

@ -0,0 +1,54 @@
//
// HeadersH1ButtonModel.swift
// MVMCoreUI
//
// Created by Lekshmi S on 04/03/20.
// Copyright © 2020 Verizon Wireless. All rights reserved.
//
import Foundation
public class HeadersH1ButtonModel: HeaderModel, MoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public static var identifier: String = "headerH1Btn"
public var headlineBody: HeadlineBodyModel
public var buttons: TwoButtonViewModel
//--------------------------------------------------
// MARK: - Initializer
//--------------------------------------------------
public init(headlineBody: HeadlineBodyModel, buttons: TwoButtonViewModel) {
self.headlineBody = headlineBody
self.buttons = buttons
super.init()
}
//--------------------------------------------------
// MARK: - Keys
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case headlineBody
case buttons
}
//--------------------------------------------------
// MARK: - Codec
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody)
buttons = try typeContainer.decode(TwoButtonViewModel.self, forKey: .buttons)
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.encode(headlineBody, forKey: .headlineBody)
try container.encode(buttons, forKey: .buttons)
}
}