// // TiletTitleModel.swift // VDS // // Created by Matt Bruce on 1/6/23. // import Foundation extension Tilelet { /// Model that represents the options available for the title label. public struct TitleModel { //-------------------------------------------------- // MARK: - Enums //-------------------------------------------------- /// Enum for the textStyle of the title label. public enum StandardStyle: String, EnumSubset { case titleXLarge case titleLarge case titleMedium case titleSmall public var defaultValue: TitleLockup.TitleStandardStyle { .titleSmall } } //-------------------------------------------------- // MARK: - Public Properties //-------------------------------------------------- /// Text that will be used for the title label. public var text: String = "" /// Text attributes that will be used for the title label. public var textAttributes: [any LabelAttributeModel]? /// Text style that will be used for the title label. public var standardStyle: StandardStyle = .titleSmall //-------------------------------------------------- // MARK: - Initializers //-------------------------------------------------- public init(text: String, textAttributes: [any LabelAttributeModel]? = nil, standardStyle: StandardStyle = .titleSmall) { self.text = text self.textAttributes = textAttributes self.standardStyle = standardStyle } //-------------------------------------------------- // MARK: - Public Methods //-------------------------------------------------- /// Converts this type of model to a TitleLockup.TitleModel. public func toTitleLockupTitleModel() -> TitleLockup.TitleModel { TitleLockup.TitleModel(text: text, textAttributes: textAttributes, standardStyle: standardStyle.value) } } }