Fix TabBar icon assets and simplify Podfile post_install.

Rename tab icons to snake_case with @2x/@3x scales, register CYL plus button at app launch, and remove redundant Podfile hooks already covered by the Xcode project.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 18:49:37 +08:00
parent a1c031c9b7
commit 43179abf2c
52 changed files with 93 additions and 82 deletions

View File

@ -18,12 +18,11 @@ final class MainTabBarController: CYLTabBarController {
///
init(services: AppServices) {
self.services = services
MainScanPlusButton.register()
super.init(nibName: nil, bundle: nil)
MainScanPlusButton.onScanTap = { [weak self] in
self?.presentGlobalScanner()
}
delegate = self
// delegate = self
}
@available(*, unavailable)
@ -86,11 +85,10 @@ final class MainTabBarController: CYLTabBarController {
tabNavigationControllers[tab] = navigationController
return navigationController
}
applyTabAccessibilityIdentifiers()
}
/// CYLTabBarController TabBarItem
private func makeTabBarItemAttributes(for tab: AppTab) -> [String: Any] {
private func makeTabBarItemAttributes(for tab: AppTab) -> [String: String] {
[
CYLTabBarItemTitle: tab.title,
CYLTabBarItemImage: tab.unselectedImageName,
@ -98,13 +96,6 @@ final class MainTabBarController: CYLTabBarController {
]
}
/// CYL TabBarItem
private func applyTabAccessibilityIdentifiers() {
for tab in AppTab.allCases {
tabNavigationControllers[tab]?.tabBarItem.accessibilityIdentifier = "main.tab.\(tab.rawValue)"
}
}
/// ViewModel
private func bindBadgeViewModel() {
badgeViewModel.onChange = { [weak self] in

View File

@ -16,10 +16,20 @@ final class MainScanPlusButton: CYLPlusButton, CYLPlusButtonSubclassing {
/// CYLTabBarController 使
static func plusButton() -> Any {
let button = MainScanPlusButton(type: .custom)
button.frame = CGRect(x: 0, y: 0, width: 70, height: 64)
button.configureAppearance()
button.addTarget(button, action: #selector(handleScanTap), for: .touchUpInside)
let button = MainScanPlusButton()
button.setImage(UIImage(named: "icon_scan"), for: .normal)
button.titleLabel?.textAlignment = .center
button.titleLabel?.font = UIFont.systemFont(ofSize: 10)
button.setTitle("发布", for: .normal)
button.setTitleColor(UIColor.gray, for: .normal)
button.setTitle("选中", for: .selected)
button.setTitleColor(UIColor(red:255.0/255.0,green:102.0/255.0,blue:0,alpha:1.0), for: .selected)
button.adjustsImageWhenHighlighted = false
button.sizeToFit()
return button
}
@ -46,7 +56,7 @@ final class MainScanPlusButton: CYLPlusButton, CYLPlusButtonSubclassing {
let symbolConfig = UIImage.SymbolConfiguration(pointSize: 30, weight: .bold)
let iconView = UIImageView(
image: UIImage(systemName: "qrcode.viewfinder", withConfiguration: symbolConfig)
image: UIImage(named: "icon_scan")
)
iconView.tintColor = .white
iconView.contentMode = .scaleAspectFit