22 lines
683 B
Swift
22 lines
683 B
Swift
//
|
||
// 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)
|
||
}
|
||
}
|