This commit is contained in:
Pfeil, Scott Robert 2020-03-17 12:15:26 -04:00
commit 29d9ea317d
4 changed files with 9 additions and 12 deletions

View File

@ -181,7 +181,7 @@ import UIKit
let widthWillChange = !MVMCoreGetterUtility.cgfequal(widthConstraint?.constant ?? 0, width ?? 0)
let heightWillChange = !MVMCoreGetterUtility.cgfequal(heightConstraint?.constant ?? 0, height ?? 0)
let sizeWillChange = (width == nil || height == nil) && !(size?.equalTo(imageView.image?.size ?? CGSize.zero) ?? false)
let heightChangeFromSpinner = ((height ?? size?.height) ?? 0) < loadingSpinnerHeightConstraint?.constant ?? CGFloat.leastNormalMagnitude
let heightChangeFromSpinner = (heightConstraint?.isActive ?? false) ? false : ((height ?? size?.height) ?? 0) < loadingSpinnerHeightConstraint?.constant ?? CGFloat.leastNormalMagnitude
return widthWillChange || heightWillChange || sizeWillChange || heightChangeFromSpinner
}

View File

@ -8,7 +8,7 @@
import Foundation
@objcMembers open class HeadersH2NoButtonsBodyText: View {
@objcMembers open class HeadersH2NoButtonsBodyText: HeaderView {
//--------------------------------------------------
// MARK: - Outlets
//--------------------------------------------------
@ -20,8 +20,7 @@ import Foundation
open override func setupView() {
super.setupView()
headlineBody.stylePageHeader()
addSubview(headlineBody)
NSLayoutConstraint.constraintPinSubview(toSuperview: headlineBody)
addMolecule(headlineBody)
}
//----------------------------------------------------

View File

@ -8,13 +8,11 @@
import Foundation
public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol {
public class HeadersH2NoButtonsBodyTextModel: HeaderModel, MoleculeModelProtocol {
//--------------------------------------------------
// MARK: - Properties
//--------------------------------------------------
public static var identifier: String = "headerH2"
public var backgroundColor: Color?
public var headlineBody: HeadlineBodyModel
//--------------------------------------------------
@ -22,6 +20,7 @@ public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol {
//--------------------------------------------------
public init(headlineBody: HeadlineBodyModel) {
self.headlineBody = headlineBody
super.init()
}
//--------------------------------------------------
@ -29,7 +28,6 @@ public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol {
//--------------------------------------------------
private enum CodingKeys: String, CodingKey {
case moleculeName
case backgroundColor
case headlineBody
}
@ -38,14 +36,14 @@ public class HeadersH2NoButtonsBodyTextModel: MoleculeModelProtocol {
//--------------------------------------------------
required public init(from decoder: Decoder) throws {
let typeContainer = try decoder.container(keyedBy: CodingKeys.self)
backgroundColor = try typeContainer.decodeIfPresent(Color.self, forKey: .backgroundColor)
headlineBody = try typeContainer.decode(HeadlineBodyModel.self, forKey: .headlineBody)
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)
try container.encode(moleculeName, forKey: .moleculeName)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)
try container.encode(headlineBody, forKey: .headlineBody)
}
}

View File

@ -114,7 +114,7 @@ import Foundation
// Designed Section Dividers
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListFourColumnDataUsageDivider.self, viewModelClass: ListFourColumnDataUsageDividerModel.self)
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: ListThreeColumnPlanDataDivider.self, viewModelClass: ListThreeColumnPlanDataDividerModel.self)
// Designed Headers
MVMCoreUIMoleculeMappingObject.shared()?.register(viewClass: HeadersH2NoButtonsBodyText.self, viewModelClass: HeadersH2NoButtonsBodyTextModel.self)