完善账号切换展示、首页菜单图标与有线传输设置 chip。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
21
suixinkan/Features/Home/Services/HomeMenuIconFactory.swift
Normal file
21
suixinkan/Features/Home/Services/HomeMenuIconFactory.swift
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// HomeMenuIconFactory.swift
|
||||
// suixinkan
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
/// 首页 / 全部功能菜单图标加载,统一 SF Symbol 与资源图的视觉尺寸。
|
||||
enum HomeMenuIconFactory {
|
||||
|
||||
/// 与菜单图标槽位(约 24–26pt)对齐的系统图标配置。
|
||||
static let symbolConfiguration = UIImage.SymbolConfiguration(pointSize: 18, weight: .medium)
|
||||
|
||||
/// 优先加载 Assets 资源图;否则按统一配置加载 SF Symbol。
|
||||
static func image(named iconName: String) -> UIImage? {
|
||||
if let asset = UIImage(named: iconName) {
|
||||
return asset
|
||||
}
|
||||
return UIImage(systemName: iconName, withConfiguration: symbolConfiguration)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user