Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,15 @@ public class BaseViewController<T: ViewModel>: UIViewController {
let viewModel: T
private var baseCancellables = Set<AnyCancellable>()
private lazy var networkErrorView = NetworkErrorView()
private var isShowingNetworkError = false

var isShowingTabBar: Bool { true }

init(viewModel: T) {
self.viewModel = viewModel
super.init(nibName: nil, bundle: nil)
}

deinit {
guard isShowingNetworkError else { return }
guard isShowingTabBar else { return }

DispatchQueue.main.async { [weak tabBarController = self.tabBarController] in
tabBarController?.tabBar.isHidden = false
Expand Down Expand Up @@ -78,15 +77,15 @@ public class BaseViewController<T: ViewModel>: UIViewController {

/// 네트워크 에러 뷰 를 보이거나 숨깁니다.
private func handleNetworkErrorView(show: Bool) {
isShowingNetworkError = show

if show {
view.bringSubviewToFront(networkErrorView)
networkErrorView.isHidden = false
tabBarController?.tabBar.isHidden = true
} else {
networkErrorView.isHidden = true
tabBarController?.tabBar.isHidden = false
if isShowingTabBar {
tabBarController?.tabBar.isHidden = false
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ final class ResultRecommendedRoutineViewController: BaseViewController<ResultRec
static let skipButtonBottomSpacing: CGFloat = 20
}

override var isShowingTabBar: Bool { false }
private let mainLabel = UILabel()
private var subLabel = UILabel()
private let recommendedRoutineStackView = UIStackView()
Expand Down
Loading