Fableon/Fableon/Object/Base/Extension/String+FAAdd.swift
2025-10-23 16:54:27 +08:00

42 lines
1.1 KiB
Swift

//
// String+FAAdd.swift
// Fableon
//
// Created by on 2025/9/15.
//
import Foundation
import SmartCodable
import YYCategories
extension String: SmartCodable {
static func timeZone() -> String {
let timeZone = NSTimeZone.local as NSTimeZone
let timeZoneSecondsFromGMT = timeZone.secondsFromGMT / 3600
return String(format: "GMT+0%d:00", timeZoneSecondsFromGMT)
}
func size(_ font: UIFont, _ size: CGSize) -> CGSize {
return (self as NSString).size(for: font, size: size, mode: .byWordWrapping)
}
}
extension String {
static let color_FFFFFF = "#FFFFFF"
static let color_000000 = "#000000"
static let color_3769FC = "#3769FC"
static let color_777777 = "#777777"
static let color_0D0D0D = "#0D0D0D"
static let color_81CAFF = "#81CAFF"
static let color_20A2FF = "#20A2FF"
static let color_DDEDFD = "#DDEDFD"
static let color_A8DBFF = "#A8DBFF"
static let color_BEDFFF = "#BEDFFF"
static let color_52A2F1 = "#52A2F1"
static let color_C7DEF5 = "#C7DEF5"
static let color_333333 = "#333333"
static let color_D9D9D9 = "#D9D9D9"
}