55 lines
1.8 KiB
Swift
55 lines
1.8 KiB
Swift
//
|
|
// TiletSubTitleModel.swift
|
|
// VDS
|
|
//
|
|
// Created by Matt Bruce on 1/6/23.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension Tilet {
|
|
public struct SubTitleModel: Codable {
|
|
//--------------------------------------------------
|
|
// MARK: - Enums
|
|
//--------------------------------------------------
|
|
public enum TextStyle: String, Codable, EnumSubset {
|
|
case BodyLarge
|
|
case BoldBodyLarge
|
|
case BodyMedium
|
|
case BoldBodyMedium
|
|
case BodySmall
|
|
case BoldBodySmall
|
|
|
|
public var defaultValue: TitleLockup.OtherTextStyle { .BodySmall }
|
|
}
|
|
|
|
//--------------------------------------------------
|
|
// MARK: - Public Properties
|
|
//--------------------------------------------------
|
|
public var text: String = ""
|
|
public var textStyle: TextStyle = .BodySmall
|
|
public var textColor: Use = .primary
|
|
|
|
//--------------------------------------------------
|
|
// MARK: - Initializers
|
|
//--------------------------------------------------
|
|
public init(text: String,
|
|
textColor: Use = .primary,
|
|
textAttributes: [any LabelAttributeModel]? = nil,
|
|
textStyle: TextStyle = .BodySmall) {
|
|
self.text = text
|
|
self.textColor = textColor
|
|
self.textStyle = textStyle
|
|
}
|
|
|
|
//--------------------------------------------------
|
|
// MARK: - Public Functions
|
|
//--------------------------------------------------
|
|
public func toTitleLockupSubTitleModel() -> TitleLockup.SubTitleModel {
|
|
TitleLockup.SubTitleModel(text: text,
|
|
textColor: textColor,
|
|
textAttributes: nil)
|
|
}
|
|
}
|
|
}
|