ThimraTV/MoviaBox/Base/Extension/UIBarButtonItem+SPAdd.swift
2025-04-29 13:27:40 +08:00

37 lines
956 B
Swift

//
// UIBarButtonItem+SPAdd.swift
// MoviaBox
//
// Created by on 2025/4/29.
//
import UIKit
extension UIBarButtonItem {
static let sp_normalTitleFont = UIFont.fontRegular(ofSize: 14)
static var sp_normalTitleColor: UIColor {
get {
return UIColor.colorFFFFFF(alpha: 0.5)
}
}
/**
*/
static var sp_normalTitleTextAttributes: [NSAttributedString.Key : Any] {
get {
return [
NSAttributedString.Key.font : sp_normalTitleFont,
NSAttributedString.Key.foregroundColor : sp_normalTitleColor
]
}
}
func sp_setTitleTextAttributes(normalAttributes: [NSAttributedString.Key : Any] = UIBarButtonItem.sp_normalTitleTextAttributes) {
self.setTitleTextAttributes(normalAttributes, for: .normal)
self.setTitleTextAttributes(normalAttributes, for: .highlighted)
}
}