Skip to content

Commit

Permalink
[Feat] #162 - DontBeTabBarController에 로딩뷰 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yeonsu0-0 committed Mar 12, 2024
1 parent c53d823 commit c1475db
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ extension DontBeTabBarController: UITabBarControllerDelegate {
self.tabBar.items?[2].image = ImageLiterals.TabBar.icnNotificationRead
}

if beforeIndex == 2 && self.selectedIndex == 0 {
showLoadingView()
}

if beforeIndex == 3 && self.selectedIndex == 0 {
showLoadingView()
}

if let selectedViewController = tabBarController.selectedViewController {
applyFontColorAttributes(to: selectedViewController.tabBarItem, isSelected: true)
}
Expand Down Expand Up @@ -200,3 +208,15 @@ extension DontBeTabBarController: UITabBarControllerDelegate {
return true
}
}

extension DontBeTabBarController {
private func showLoadingView() {
let loadingView = DontBeLoadingView()
loadingView.show()

DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
loadingView.hide {
}
}
}
}

0 comments on commit c1475db

Please sign in to comment.