Skip to content

Commit 54e35cd

Browse files
committed
Refactor: 온보딩 첫 화면에서 백버튼 제거
1 parent 03f40e2 commit 54e35cd

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Projects/Presentation/Sources/Common/Extension/UIViewController+.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ extension UIViewController {
2828
navigationController?.setNavigationBarHidden(false, animated: false)
2929
configureCustomBackButton()
3030
configureProgressNavigationBar(step: step, stepCount: stepCount)
31+
32+
case .withPrograssBarWithoutBackButton(let step, let stepCount):
33+
navigationController?.setNavigationBarHidden(false, animated: false)
34+
navigationController?.navigationItem.setHidesBackButton(true, animated: false)
35+
configureProgressNavigationBar(step: step, stepCount: stepCount)
3136
}
3237
}
3338

@@ -101,4 +106,5 @@ enum NavigationBarStyle {
101106
case withBackButton(title: String)
102107
case withPrograssBar(step: Int, stepCount: Int)
103108
case withPrograssBarWithCustomBackButton(step: Int, stepCount: Int)
109+
case withPrograssBarWithoutBackButton(step: Int, stepCount: Int)
104110
}

Projects/Presentation/Sources/Onboarding/View/OnboardingView.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public final class OnboardingView: BaseViewController<OnboardingViewModel> {
5757
super.viewWillAppear(animated)
5858

5959
let stepCount = OnboardingType.allCases.count + 1
60-
configureNavigationBar(navigationStyle: .withPrograssBar(step: onboarding.step, stepCount: stepCount))
60+
if !isFromMypage && onboarding == .time {
61+
configureNavigationBar(navigationStyle: .withPrograssBarWithoutBackButton(step: onboarding.step, stepCount: stepCount))
62+
} else {
63+
configureNavigationBar(navigationStyle: .withPrograssBar(step: onboarding.step, stepCount: stepCount))
64+
}
6165

6266
self.viewModel.action(input: .fetchOnboardingChoice(onboarding: onboarding))
6367
}

0 commit comments

Comments
 (0)