Skip to content

Commit

Permalink
[GWL-334] 카운트다운 화면, WorkoutSession, WorkoutSummery 화면에서 TabBar 보이는 버그…
Browse files Browse the repository at this point in the history
… 수정 (#335)

* feat: 운동 기록중에 보이는 tapbar hidden 처리 완료

* feat: 순환참조 문제 해결

* feat: 순환 참조 문제 해결
  • Loading branch information
MaraMincho authored Dec 10, 2023
1 parent dda815c commit 531ed60
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ extension RecordFeatureCoordinator: CoordinatorFinishDelegate {

extension RecordFeatureCoordinator: WorkoutSettingCoordinatorFinishDelegate {
func workoutSettingCoordinatorDidFinished(workoutSessionComponents: WorkoutSessionComponents) {
childCoordinators.removeAll()
navigationController.dismiss(animated: false)
showWorkoutFlow(workoutSessionComponents)
}
Expand All @@ -104,6 +105,7 @@ extension RecordFeatureCoordinator: WorkoutSettingCoordinatorFinishDelegate {

extension RecordFeatureCoordinator: WorkoutSessionFinishDelegate {
public func moveToMainRecord() {
childCoordinators.removeAll()
start()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ final class WorkoutSessionCoordinator: WorkoutSessionCoordinating {
healthDataProtocol: sessionViewController,
locationTrackingProtocol: routeMapViewController
)
navigationController.pushViewController(viewController, animated: true)
viewController.hidesBottomBarWhenPushed = true

navigationController.setViewControllers([viewController], animated: true)
}

func pushWorkoutSummaryViewController(recordID: Int) {
Expand All @@ -189,6 +191,8 @@ final class WorkoutSessionCoordinator: WorkoutSessionCoordinating {
let useCase = WorkoutSummaryUseCase(repository: repository, workoutRecordID: recordID)
let viewModel = WorkoutSummaryViewModel(coordinating: self, workoutSummaryUseCase: useCase)
let workoutSummaryViewController = WorkoutSummaryViewController(viewModel: viewModel)
workoutSummaryViewController.hidesBottomBarWhenPushed = true

navigationController.setViewControllers([workoutSummaryViewController], animated: true)
}

Expand All @@ -199,6 +203,8 @@ final class WorkoutSessionCoordinator: WorkoutSessionCoordinating {
let viewModel = CountDownBeforeWorkoutViewModel(coordinator: self, useCase: useCase)

let viewController = CountDownBeforeWorkoutViewController(viewModel: viewModel)
viewController.hidesBottomBarWhenPushed = true

navigationController.setViewControllers([viewController], animated: true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ private extension CountDownBeforeWorkoutViewController {

func setupStyles() {
view.backgroundColor = DesignSystemColor.primaryBackground
hidesBottomBarWhenPushed = true
}

func bindViewModel() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ protocol CountDownBeforeWorkoutViewModelRepresentable {
final class CountDownBeforeWorkoutViewModel {
// MARK: - Properties

weak var coordinator: WorkoutSessionCoordinating?
var timerUseCase: CountDownBeforeWorkoutStartTimerUseCaseRepresentable
private weak var coordinator: WorkoutSessionCoordinating?
private var timerUseCase: CountDownBeforeWorkoutStartTimerUseCaseRepresentable
private var subscriptions: Set<AnyCancellable> = []
private var beforeWorkoutTimerSubject: CurrentValueSubject<String, Never> = .init("")
init(coordinator: WorkoutSessionCoordinating, useCase: CountDownBeforeWorkoutStartTimerUseCaseRepresentable) {
self.coordinator = coordinator
timerUseCase = useCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ private extension WorkoutEnvironmentSetupViewController {
navigationController?.navigationBar.isHidden = false
navigationController?.navigationBar.tintColor = DesignSystemColor.main03

let titleBarButtonItemFont: UIFont = .preferredFont(forTextStyle: .title3, weight: .semibold)
navigationController?.tabBarItem.setTitleTextAttributes([.font: titleBarButtonItemFont], for: .normal)
view.backgroundColor = DesignSystemColor.primaryBackground
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ final class WorkoutSelectViewController: UIViewController {
bind()
}

private var cancellables = Set<AnyCancellable>()
private var subscriptions = Set<AnyCancellable>()
weak var delegate: WorkoutSelectViewDelegate?

private let workoutSelectDescriptionLabel: UILabel = {
Expand Down Expand Up @@ -113,7 +113,7 @@ private extension WorkoutSelectViewController {
.sink { [weak self] _ in
self?.delegate?.nextButtonDidTap()
}
.store(in: &cancellables)
.store(in: &subscriptions)
}

enum Metrics {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,9 @@ final class WorkoutRouteMapViewController: UIViewController {

viewModel
.transform(input: input)
.sink(receiveValue: render(state:))
.sink { [weak self] state in
self?.render(state: state)
}
.store(in: &subscriptions)
}

Expand Down

0 comments on commit 531ed60

Please sign in to comment.