47 lines
1.5 KiB
Swift
47 lines
1.5 KiB
Swift
//
|
|
// TiletBadgeModel.swift
|
|
// VDS
|
|
//
|
|
// Created by Matt Bruce on 1/6/23.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
|
|
extension Tilelet {
|
|
|
|
/// Model that represents the options available for the badge.
|
|
public struct BadgeModel: Equatable {
|
|
/// Text that will be used for the badge.
|
|
public var text: String = ""
|
|
|
|
/// Text color that will be used for the badge.
|
|
public var textColor: Badge.TextColor?
|
|
|
|
/// Fill color that will be used for the badge.
|
|
public var fillColor: Badge.FillColor
|
|
|
|
/// Current Surface and this is used to pass down to child objects that implement Surfacable
|
|
public var surface: Surface
|
|
|
|
/// Number of lines that will be used for the badge.
|
|
public var numberOfLines: Int
|
|
|
|
/// Max width that will be used for the badge.
|
|
public var maxWidth: CGFloat?
|
|
|
|
/// LineBreakMode used in Badge label.
|
|
public var lineBreakMode: NSLineBreakMode
|
|
|
|
public init(text: String, textColor: Badge.TextColor? = nil, fillColor: Badge.FillColor = .red, surface: Surface = .light, numberOfLines: Int = 0, maxWidth: CGFloat? = nil, lineBreakMode: NSLineBreakMode = .byTruncatingTail) {
|
|
self.text = text
|
|
self.textColor = textColor
|
|
self.fillColor = fillColor
|
|
self.surface = surface
|
|
self.numberOfLines = numberOfLines
|
|
self.maxWidth = maxWidth
|
|
self.lineBreakMode = lineBreakMode
|
|
}
|
|
}
|
|
}
|