GBA-8-19/CGame/Scenes/gp_label.swift
bluesea 66c5202be8 s
2024-06-14 18:12:40 +08:00

48 lines
1.3 KiB
Swift

//
// gp_label.swift
// Hthik
//
// Created by 16 on 2024/5/31.
// Copyright © 2024 Hthik. All rights reserved.
//
import Foundation
import UIKit
class LabelModifier {
//
static func changeTextColor(of label: UILabel, to color: UIColor) {
label.textColor = color
}
//
static func changeBackgroundColor(of label: UILabel, to color: UIColor) {
label.backgroundColor = color
}
//
static func changeColors(of label: UILabel, textColor: UIColor, backgroundColor: UIColor) {
label.textColor = textColor
label.backgroundColor = backgroundColor
}
//
static func changeFont(of label: UILabel, to font: UIFont) {
label.font = font
}
//
static func changeText(of label: UILabel, to text: String) {
label.text = text
}
//
static func changeAttributes(of label: UILabel, textColor: UIColor, backgroundColor: UIColor, font: UIFont, text: String) {
label.textColor = textColor
label.backgroundColor = backgroundColor
label.font = font
label.text = text
}
}