also refactored models into class that are the parents Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
51 lines
1.5 KiB
Swift
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)
|
|
}
|
|
}
|