// // 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) } }