open for mobile first

This commit is contained in:
Pfeil, Scott Robert 2020-02-28 14:08:38 -05:00
parent 01a36a0245
commit 2e99d980e8
6 changed files with 17 additions and 17 deletions

View File

@ -8,7 +8,7 @@
import Foundation
public class ContainerModel: ContainerModelProtocol, Codable {
open class ContainerModel: ContainerModelProtocol, Codable {
public var horizontalAlignment: UIStackView.Alignment?
public var verticalAlignment: UIStackView.Alignment?
public var useHorizontalMargins: Bool?
@ -48,7 +48,7 @@ public class ContainerModel: ContainerModelProtocol, Codable {
bottomMarginPadding = try typeContainer.decodeIfPresent(CGFloat.self, forKey: .bottomMarginPadding)
}
public func encode(to encoder: Encoder) throws {
open func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(ContainerHelper.getAlignmentString(for: verticalAlignment), forKey: .verticalAlignment)
try container.encodeIfPresent(ContainerHelper.getAlignmentString(for: horizontalAlignment), forKey: .horizontalAlignment)

View File

@ -8,8 +8,8 @@
import Foundation
public class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
public class var identifier: String {
open class ListLeftVariableCheckboxAllTextAndLinksModel: ListItemModel, MoleculeModelProtocol {
open class var identifier: String {
return "listLVCB"
}
public var checkbox: CheckboxModel

View File

@ -9,7 +9,7 @@
import Foundation
@objcMembers public class ListItemModel: ContainerModel, ListItemModelProtocol {
@objcMembers open class ListItemModel: ContainerModel, ListItemModelProtocol {
public var backgroundColor: Color?
public var action: ActionModelProtocol?
public var hideArrow: Bool?
@ -25,7 +25,7 @@ import Foundation
}
/// Defaults to set
public func setDefaults() {
open func setDefaults() {
if useHorizontalMargins == nil {
useHorizontalMargins = true
}
@ -53,7 +53,7 @@ import Foundation
setDefaults()
}
public override func encode(to encoder: Encoder) throws {
open override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(backgroundColor, forKey: .backgroundColor)

View File

@ -13,11 +13,11 @@ import UIKit
// MARK: - Outlets
//--------------------------------------------------
let stack = Stack<StackModel>(frame: .zero)
let eyebrow = Label.commonLabelB3(true)
let headline = Label.commonLabelB1(true)
let body = Label.commonLabelB2(true)
let link = Link()
public let stack = Stack<StackModel>(frame: .zero)
public let eyebrow = Label.commonLabelB3(true)
public let headline = Label.commonLabelB1(true)
public let body = Label.commonLabelB2(true)
public let link = Link()
var casteModel: EyebrowHeadlineBodyLinkModel? {
get { return model as? EyebrowHeadlineBodyLinkModel }
@ -72,7 +72,7 @@ import UIKit
stack.restack()
}
public override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
open override class func estimatedHeight(with model: MoleculeModelProtocol, _ delegateObject: MVMCoreUIDelegateObject?) -> CGFloat? {
return 65
}
}

View File

@ -9,7 +9,7 @@
import UIKit
open class MoleculeStackView: Stack<MoleculeStackModel> {
override var stackModel: MoleculeStackModel? {
open override var stackModel: MoleculeStackModel? {
get { return model as? MoleculeStackModel }
}

View File

@ -14,11 +14,11 @@ open class Stack<T>: Container where T: (StackModelProtocol & MoleculeModelProto
// MARK: - Properties
//--------------------------------------------------
var contentView: UIView = MVMCoreUICommonViewsUtility.commonView()
var stackModel: T? {
open var contentView: UIView = MVMCoreUICommonViewsUtility.commonView()
open var stackModel: T? {
get { return model as? T }
}
var stackItems: [UIView] = []
open var stackItems: [UIView] = []
//--------------------------------------------------
// MARK: - Helpers