update
This commit is contained in:
parent
438277b37f
commit
f378e66731
@ -12,6 +12,19 @@ import Foundation
|
||||
@objcMembers public class LabelModel: MoleculeModelProtocol {
|
||||
|
||||
public enum FontStyle: String, Codable {
|
||||
case Title2XLarge
|
||||
case TitleXLarge
|
||||
case BoldTitleLarge
|
||||
case RegularTitleLarge
|
||||
case BoldTitleMedium
|
||||
case RegularTitleMedium
|
||||
case BoldBodyLarge
|
||||
case RegularBodyLarge
|
||||
case BoldBodySmall
|
||||
case RegularBodySmall
|
||||
case BoldMicro
|
||||
case RegularMicro
|
||||
// Legacy
|
||||
case H1
|
||||
case H2
|
||||
case H3
|
||||
|
||||
@ -18,18 +18,18 @@ import Foundation
|
||||
}
|
||||
|
||||
/// Registers the model with the model registry and the view with the mapper.
|
||||
func register<M: ModelProtocol, V: MoleculeViewProtocol>(viewClass: V.Type, viewModelClass: M.Type) {
|
||||
public func register<M: ModelProtocol, V: MoleculeViewProtocol>(viewClass: V.Type, viewModelClass: M.Type) {
|
||||
try? ModelRegistry.register(viewModelClass)
|
||||
moleculeMapping.updateValue(viewClass, forKey: viewModelClass.identifier)
|
||||
}
|
||||
|
||||
/// Returns the type of molecule view for the given model
|
||||
func getMoleculeClass(_ model: MoleculeModelProtocol) -> MoleculeViewProtocol.Type? {
|
||||
public func getMoleculeClass(_ model: MoleculeModelProtocol) -> MoleculeViewProtocol.Type? {
|
||||
return moleculeMapping[model.moleculeName]
|
||||
}
|
||||
|
||||
/// Creates a molecule with the given model.
|
||||
func createMolecule(_ model: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> MoleculeViewProtocol? {
|
||||
public func createMolecule(_ model: MoleculeModelProtocol, delegateObject: MVMCoreUIDelegateObject? = nil, additionalData: [AnyHashable: Any]? = nil) -> MoleculeViewProtocol? {
|
||||
guard let type = moleculeMapping[model.moleculeName] else { return nil }
|
||||
return type.init(model: model, delegateObject, additionalData)
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import UIKit
|
||||
open class HeadlineBody: View {
|
||||
let headlineLabel = Label.commonLabelH2(true)
|
||||
let messageLabel = Label.commonLabelB2(true)
|
||||
var spaceBetweenLabelsConstant = PaddingTwo
|
||||
var spaceBetweenLabelsConstant = PaddingOne
|
||||
var spaceBetweenLabels: NSLayoutConstraint?
|
||||
var leftConstraintTitle: NSLayoutConstraint?
|
||||
var rightConstraintTitle: NSLayoutConstraint?
|
||||
|
||||
@ -28,11 +28,11 @@ open class Carousel: View {
|
||||
/// The number of pages that there are. Used for the page control and for calculations. Should not include the looping dummy cells. Be sure to set this if subclassing and not using the molecules.
|
||||
open var numberOfPages = 0
|
||||
|
||||
/// The json for the molecules.
|
||||
/// The models for the molecules.
|
||||
var molecules: [MoleculeModelProtocol]?
|
||||
|
||||
/// The horizontal alignment of the cell in the collection view. Only noticeable if the itemWidthPercent is less than 100%.
|
||||
var itemAlignment = UICollectionView.ScrollPosition.left
|
||||
public var itemAlignment = UICollectionView.ScrollPosition.left
|
||||
|
||||
/// From 0-1. The item width as a percent of the carousel width.
|
||||
public var itemWidthPercent: Float = 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user