efficiency changes
This commit is contained in:
parent
c9148aabd5
commit
7729529a9c
@ -14,15 +14,25 @@ import Foundation
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public let headlineBody = HeadlineBody(frame: .zero)
|
public let headlineBody = HeadlineBody(frame: .zero)
|
||||||
public let buttons = TwoButtonView(frame: .zero)
|
public let buttons = TwoButtonView(frame: .zero)
|
||||||
public var stack = Stack<StackModel>(frame: .zero)
|
public let stack: Stack<StackModel>
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// MARK: - Initializers
|
||||||
|
//-------------------------------------------------------
|
||||||
|
public override init(frame: CGRect) {
|
||||||
|
stack = Stack<StackModel>.createStack(with: [headlineBody, buttons], spacing: PaddingDefaultVerticalSpacing3)
|
||||||
|
super.init(frame: frame)
|
||||||
|
}
|
||||||
|
|
||||||
|
public required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
// MARK: - View Lifecycle
|
// MARK: - View Lifecycle
|
||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
stack.model = StackModel(molecules: [], axis: .vertical, spacing: 0)
|
|
||||||
stack.set(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .fill)), (view: buttons, model: StackItemModel(spacing: PaddingDefaultVerticalSpacing3, horizontalAlignment: .fill))])
|
|
||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
|
|||||||
@ -14,7 +14,19 @@ import Foundation
|
|||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
public let headlineBody = HeadlineBody(frame: .zero)
|
public let headlineBody = HeadlineBody(frame: .zero)
|
||||||
public let button = PillButton(frame: .zero)
|
public let button = PillButton(frame: .zero)
|
||||||
public var stack = Stack<StackModel>(frame: .zero)
|
public let stack: Stack<StackModel>
|
||||||
|
|
||||||
|
//-------------------------------------------------------
|
||||||
|
// MARK: - Initializers
|
||||||
|
//-------------------------------------------------------
|
||||||
|
public override init(frame: CGRect) {
|
||||||
|
stack = Stack<StackModel>.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .fill)), (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical)
|
||||||
|
super.init(frame: frame)
|
||||||
|
}
|
||||||
|
|
||||||
|
public required init?(coder: NSCoder) {
|
||||||
|
fatalError("init(coder:) has not been implemented")
|
||||||
|
}
|
||||||
|
|
||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
// MARK: - Constants
|
// MARK: - Constants
|
||||||
@ -26,7 +38,6 @@ import Foundation
|
|||||||
//-------------------------------------------------------
|
//-------------------------------------------------------
|
||||||
open override func setupView() {
|
open override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
stack = Stack<StackModel>.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .fill)), (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical)
|
|
||||||
headlineBody.stylePageHeader()
|
headlineBody.stylePageHeader()
|
||||||
addMolecule(stack)
|
addMolecule(stack)
|
||||||
stack.restack()
|
stack.restack()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user