vds_ios/VDS/Components/Tilet/TiletTitleModel.swift
Matt Bruce 669e0d7625 refactored enums into class/structs that use them
also refactored models into class that are the parents

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
2023-01-13 13:32:38 -06:00

51 lines
1.5 KiB
Swift

//
// TiletTitleModel.swift
// VDS
//
// Created by Matt Bruce on 1/6/23.
//
import Foundation
public struct TiletTitleModel: Codable {
//--------------------------------------------------
// MARK: - Enums
//--------------------------------------------------
public enum TextStyle: String, EnumSubset, Codable {
case TitleXLarge
case BoldTitleXLarge
case TitleLarge
case BoldTitleLarge
case TitleMedium
case BoldTitleMedium
case TitleSmall
case BoldTitleSmall
public var defaultValue: TitleLockup.TitleTextStyle { .BoldTitleSmall }
}
//--------------------------------------------------
// MARK: - Public Properties
//--------------------------------------------------
public var text: String = ""
public var textStyle: TextStyle = .BoldTitleSmall
//--------------------------------------------------
// MARK: - Initializers
//--------------------------------------------------
public init(text: String,
textStyle: TextStyle = .BoldTitleSmall) {
self.text = text
self.textStyle = textStyle
}
//--------------------------------------------------
// MARK: - Public Functions
//--------------------------------------------------
public func toTitleLockupTitleModel() -> TitleLockup.TitleModel {
TitleLockup.TitleModel(text: text,
textAttributes: nil,
textStyle: textStyle.value)
}
}