Skip to content

Commit d40382e

Browse files
committed
[Chore] #219 - 정보수정 Route 개인정보수정뷰로 수정
1 parent c29eaba commit d40382e

7 files changed

Lines changed: 24 additions & 5 deletions

File tree

CERTI-iOS/Presentation/MyPage/Coordinator/MyPageCoordinatorView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct MyPageCoordinatorView: View {
7272
.navigationDestination(for: MyPageRoute.self) { route in
7373
switch route {
7474
case .editProfile:
75-
EditProfileView(viewModel: myPageViewModel)
75+
EditProfileView(viewModel: myPageViewModel) { myPageCoordinator.pop() }
7676
.navigationBarBackButtonHidden()
7777

7878
case .manageAcademicInfo:

CERTI-iOS/Presentation/MyPage/View/EditProfileView.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct EditProfileView: View {
2323
}
2424

2525
private let maxLength = 7
26+
let onBack: () -> Void
2627

2728
var body: some View {
2829
VStack(alignment: .leading, spacing: 0) {
@@ -40,7 +41,7 @@ struct EditProfileView: View {
4041
}
4142
} backButtonAction: {
4243
viewModel.nickNameValid = nil
43-
viewModel.myPageViewRoutePop()
44+
onBack()
4445
}
4546

4647
ScrollView(.vertical) {

CERTI-iOS/Presentation/Resume/Coordinator/ResumeCoordinator.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ enum ResumeRoute: Hashable {
1313
case myCareerWriteView(mode: CareerWriteMode)
1414
case myActivityManageView
1515
case myActivityWriteView(mode: ActivityWriteMode)
16+
case editProfile
1617
}
1718

1819
final class ResumeCoordinator: ObservableObject {

CERTI-iOS/Presentation/Resume/View/ResumeCoordinatorView.swift

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,18 @@ struct ResumeCoordinatorView: View {
1212

1313
@ObservedObject var resumeCoordinator: ResumeCoordinator
1414
@StateObject var resumeViewModel: ResumeViewModel
15+
@StateObject var myPageViewModel: MyPageViewModel
1516

1617
private let resumeFactory: ResumeFactory
18+
private let myPageFactory: MyPageFactory
19+
1720

18-
init(resumeCoordinator: ResumeCoordinator, resumeFactory: ResumeFactory) {
21+
init(resumeCoordinator: ResumeCoordinator, resumeFactory: ResumeFactory, myPageFactory: MyPageFactory) {
1922
self.resumeCoordinator = resumeCoordinator
2023
self.resumeFactory = resumeFactory
2124
_resumeViewModel = StateObject(wrappedValue: resumeFactory.makeResumeViewModel())
25+
self.myPageFactory = myPageFactory
26+
_myPageViewModel = StateObject(wrappedValue: myPageFactory.makeMyPageViewModel())
2227
}
2328

2429
var body: some View {
@@ -39,6 +44,8 @@ struct ResumeCoordinatorView: View {
3944
resumeCoordinator.push(next: .myCareerManageView)
4045
case .resumeViewRoutePop:
4146
resumeCoordinator.pop()
47+
case .navigateToEditProfile:
48+
resumeCoordinator.push(next: .editProfile)
4249
}
4350
resumeViewModel.resumeViewRoute = nil
4451
}
@@ -54,6 +61,11 @@ struct ResumeCoordinatorView: View {
5461
MyActivityManageView(viewModel: resumeViewModel)
5562
case .myActivityWriteView(let mode):
5663
MyActivityWriteView(viewModel: resumeViewModel, mode: mode)
64+
case .editProfile:
65+
EditProfileView(viewModel: myPageViewModel) {
66+
resumeCoordinator.pop()
67+
}
68+
.navigationBarBackButtonHidden()
5769
}
5870
}
5971
}

CERTI-iOS/Presentation/Resume/View/ResumeView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ extension ResumeView {
8787
Spacer()
8888

8989
Button {
90-
tabRouter.switchTab(tab: .mypage)
90+
viewModel.navigateToEditProfile()
9191
} label: {
9292
HStack(alignment: .center, spacing: 0) {
9393
Image(.iconEdit16)

CERTI-iOS/Presentation/Resume/ViewModel/ResumeViewModel.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ enum ResumeViewRoute: Equatable {
1717
case navigateToActivityManage
1818

1919
case resumeViewRoutePop
20+
case navigateToEditProfile
2021
}
2122

2223
enum CareerWriteMode: Hashable {
@@ -166,6 +167,10 @@ extension ResumeViewModel {
166167
func resumeViewRoutePop() {
167168
resumeViewRoute = .resumeViewRoutePop
168169
}
170+
171+
func navigateToEditProfile() {
172+
resumeViewRoute = .navigateToEditProfile
173+
}
169174
}
170175

171176

CERTI-iOS/Presentation/TabBar/View/CertiTabBarCoordinatorView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct CertiTabBarCoordinatorView: View {
2626
case .certificate:
2727
CertificateCoordinatorView(certificateCoordinator: tabCoordinator.certificateCoordinator, certificateFactory: appDIContainer.makeCertificateFactory(), certificateDetailFactory: appDIContainer.makeCertificateDetailFactory())
2828
case .resume:
29-
ResumeCoordinatorView(resumeCoordinator: tabCoordinator.resumeCoordinator, resumeFactory: appDIContainer.makeResumeFactory())
29+
ResumeCoordinatorView(resumeCoordinator: tabCoordinator.resumeCoordinator, resumeFactory: appDIContainer.makeResumeFactory(), myPageFactory: appDIContainer.makeMyPageFactory())
3030
case .mypage:
3131
MyPageCoordinatorView(myPageCoordinator: tabCoordinator.mypageCoordinator, myPageFactory: appDIContainer.makeMyPageFactory(), certificateDetailFactory: appDIContainer.makeCertificateDetailFactory())
3232
}

0 commit comments

Comments
 (0)