Merge branch 'develop' into feature/package-refactor

This commit is contained in:
CMK 2022-11-01 12:16:14 +08:00
commit fe596147fd
1 changed files with 10 additions and 9 deletions

View File

@ -36,6 +36,7 @@ class MainTabBarController: UITabBarController {
button.layer.masksToBounds = true button.layer.masksToBounds = true
button.layer.cornerCurve = .continuous button.layer.cornerCurve = .continuous
button.layer.cornerRadius = 8 button.layer.cornerRadius = 8
button.isAccessibilityElement = false
return button return button
}() }()
@ -200,14 +201,6 @@ extension MainTabBarController {
viewController.tabBarItem.largeContentSizeImage = tab.largeImage.imageWithoutBaseline() viewController.tabBarItem.largeContentSizeImage = tab.largeImage.imageWithoutBaseline()
viewController.tabBarItem.accessibilityLabel = tab.title viewController.tabBarItem.accessibilityLabel = tab.title
viewController.tabBarItem.imageInsets = UIEdgeInsets(top: 6, left: 0, bottom: -6, right: 0) viewController.tabBarItem.imageInsets = UIEdgeInsets(top: 6, left: 0, bottom: -6, right: 0)
switch tab {
case .compose:
viewController.tabBarItem.isEnabled = false
default:
break
}
return viewController return viewController
} }
_viewControllers = viewControllers _viewControllers = viewControllers
@ -367,7 +360,7 @@ extension MainTabBarController {
extension MainTabBarController { extension MainTabBarController {
@objc private func composeButtonDidPressed(_ sender: UIButton) { @objc private func composeButtonDidPressed(_ sender: Any) {
logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public)") logger.log(level: .debug, "\((#file as NSString).lastPathComponent, privacy: .public)[\(#line, privacy: .public)], \(#function, privacy: .public)")
guard let authContext = self.authContext else { return } guard let authContext = self.authContext else { return }
let composeViewModel = ComposeViewModel( let composeViewModel = ComposeViewModel(
@ -510,6 +503,14 @@ extension MainTabBarController {
// MARK: - UITabBarControllerDelegate // MARK: - UITabBarControllerDelegate
extension MainTabBarController: UITabBarControllerDelegate { extension MainTabBarController: UITabBarControllerDelegate {
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
if let tab = Tab(rawValue: viewController.tabBarItem.tag), tab == .compose {
composeButtonDidPressed(tabBarController)
return false
}
return true
}
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) { func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: select %s", ((#file as NSString).lastPathComponent), #line, #function, viewController.debugDescription) os_log(.info, log: .debug, "%{public}s[%{public}ld], %{public}s: select %s", ((#file as NSString).lastPathComponent), #line, #function, viewController.debugDescription)
defer { defer {