Commit 1dfb8bfa authored by Steven杜宇's avatar Steven杜宇

// 消息

parent 54a8f2fb
......@@ -20,7 +20,6 @@ class YHTabBarViewController: ESTabBarController {
super.viewDidLoad()
handleTabBarLine()
addObservers()
self.delegate = self
}
func addObservers() {
......@@ -103,15 +102,3 @@ extension YHTabBarViewController {
}
}
}
extension YHTabBarViewController: UITabBarControllerDelegate {
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
if let vcs = self.viewControllers, let msgVC = vcs[safe: 2], viewController == msgVC {
// 点击消息tab 清空应用icon未读数
UIApplication.shared.applicationIconBadgeNumber = 8
}
}
}
......@@ -212,13 +212,17 @@ extension YHHomePageViewController : UITabBarControllerDelegate {
}
}
self.tapTimestamp = timestamp
} else if tabBarController.selectedIndex == 2 {
// 点击消息tab 清空应用icon未读数
UIApplication.shared.applicationIconBadgeNumber = 0
}
}
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
let index = tabBarController.viewControllers?.firstIndex(of: viewController)
if index == 1 {
if index == 1 || index == 2 {
if YHLoginManager.shared.isLogin() {
return true
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment