diff --git a/project/Projects/App/Sources/RootCoordinator/Main/Center /SubCoordinator/CenterSettingCoordinator.swift b/project/Projects/App/Sources/RootCoordinator/Main/Center /SubCoordinator/CenterSettingCoordinator.swift index c667b908..107170ef 100644 --- a/project/Projects/App/Sources/RootCoordinator/Main/Center /SubCoordinator/CenterSettingCoordinator.swift +++ b/project/Projects/App/Sources/RootCoordinator/Main/Center /SubCoordinator/CenterSettingCoordinator.swift @@ -11,7 +11,7 @@ import RootFeature import PresentationCore import UseCaseInterface -class CenterSettingCoordinator: CenterSettingScreenCoordinatable { +class CenterSettingCoordinator: CenterSettingCoordinatable { struct Dependency { let parent: CenterMainCoordinatable @@ -34,12 +34,11 @@ class CenterSettingCoordinator: CenterSettingScreenCoordinatable { self.parent = dependency.parent } - public func start() { + func start() { let coordinator = CenterSettingScreenCoordinator( dependency: .init( navigationController: navigationController, - settingUseCase: injector.resolve(SettingScreenUseCase.self), - centerProfileUseCase: injector.resolve(CenterProfileUseCase.self) + settingUseCase: injector.resolve(SettingScreenUseCase.self) ) ) addChildCoordinator(coordinator) @@ -47,7 +46,7 @@ class CenterSettingCoordinator: CenterSettingScreenCoordinatable { coordinator.start() } - public func startRemoveCenterAccountFlow() { + func startRemoveCenterAccountFlow() { let coordinator = DeRegisterCoordinator( dependency: .init( userType: .center, @@ -60,4 +59,17 @@ class CenterSettingCoordinator: CenterSettingScreenCoordinatable { coordinator.parent = self coordinator.start() } + + func showMyCenterProfile() { + let coordinator = CenterProfileCoordinator( + dependency: .init( + mode: .myProfile, + profileUseCase: injector.resolve(CenterProfileUseCase.self), + navigationController: navigationController + ) + ) + addChildCoordinator(coordinator) + coordinator.parent = self + coordinator.start() + } } diff --git a/project/Projects/App/Sources/RootCoordinator/Main/Center /SubCoordinator/RecruitmentManagementCoordinator.swift b/project/Projects/App/Sources/RootCoordinator/Main/Center /SubCoordinator/RecruitmentManagementCoordinator.swift index 0c6f93f3..868fad79 100644 --- a/project/Projects/App/Sources/RootCoordinator/Main/Center /SubCoordinator/RecruitmentManagementCoordinator.swift +++ b/project/Projects/App/Sources/RootCoordinator/Main/Center /SubCoordinator/RecruitmentManagementCoordinator.swift @@ -109,4 +109,17 @@ public extension RecruitmentManagementCoordinator { coordinator.parent = self coordinator.start() } + + func showRegisterPostScrean() { + + let coordinator = RegisterRecruitmentPostCoordinator( + dependency: .init( + navigationController: navigationController, + recruitmentPostUseCase: injector.resolve(RecruitmentPostUseCase.self) + ) + ) + addChildCoordinator(coordinator) + coordinator.parent = self + coordinator.start() + } } diff --git a/project/Projects/Domain/ConcreteUseCase/Setting/DefaultSettingUseCase.swift b/project/Projects/Domain/ConcreteUseCase/Setting/DefaultSettingUseCase.swift index d6cd9d50..3f37ee1a 100644 --- a/project/Projects/Domain/ConcreteUseCase/Setting/DefaultSettingUseCase.swift +++ b/project/Projects/Domain/ConcreteUseCase/Setting/DefaultSettingUseCase.swift @@ -73,13 +73,25 @@ public class DefaultSettingUseCase: SettingScreenUseCase { } public func getPersonalDataUsageDescriptionUrl() -> URL { + // MARK: TODO URL(string: "")! } public func getApplicationPolicyUrl() -> URL { + // MARK: TODO URL(string: "")! } + public func getWorkerProfile() -> Entity.WorkerProfileVO { + // 세팅화면이라면 반드시 존재해야한다. + userInfoLocalRepository.getCurrentWorkerData()! + } + + public func getCenterProfile() -> Entity.CenterProfileVO { + // 세팅화면이라면 반드시 존재해야한다. + userInfoLocalRepository.getCurrentCenterData()! + } + // MARK: 회원탈퇴 & 로그아웃 // 센터 회원탈퇴 public func deregisterCenterAccount(reasons: [Entity.DeregisterReasonVO], password: String) -> RxSwift.Single> { diff --git a/project/Projects/Domain/UseCaseInterface/Setting/SettingScreenUseCase .swift b/project/Projects/Domain/UseCaseInterface/Setting/SettingScreenUseCase .swift index 314c551b..f6bb3874 100644 --- a/project/Projects/Domain/UseCaseInterface/Setting/SettingScreenUseCase .swift +++ b/project/Projects/Domain/UseCaseInterface/Setting/SettingScreenUseCase .swift @@ -29,6 +29,10 @@ public protocol SettingScreenUseCase: UseCaseBase { /// 어플리케이션 이용약관을 가져옵니다. func getApplicationPolicyUrl() -> URL + // MARK: Worker + /// 센터 프로필정보 가져오기 + func getWorkerProfile() -> WorkerProfileVO + /// 요양보호사 회원 탈퇴 func deregisterWorkerAccount( reasons: [DeregisterReasonVO] @@ -37,6 +41,11 @@ public protocol SettingScreenUseCase: UseCaseBase { /// 요양보호사 로그아웃 func signoutWorkerAccount() -> Single> + // MARK: Center + + /// 센터 프로필정보 가져오기 + func getCenterProfile() -> CenterProfileVO + /// 센터 회원 탈퇴 func deregisterCenterAccount( reasons: [DeregisterReasonVO], diff --git a/project/Projects/Presentation/DSKit/Resources/Icons.xcassets/plus.imageset/Contents.json b/project/Projects/Presentation/DSKit/Resources/Icons.xcassets/plus.imageset/Contents.json new file mode 100644 index 00000000..a23b7466 --- /dev/null +++ b/project/Projects/Presentation/DSKit/Resources/Icons.xcassets/plus.imageset/Contents.json @@ -0,0 +1,12 @@ +{ + "images" : [ + { + "filename" : "plus.svg", + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/project/Projects/Presentation/DSKit/Resources/Icons.xcassets/plus.imageset/plus.svg b/project/Projects/Presentation/DSKit/Resources/Icons.xcassets/plus.imageset/plus.svg new file mode 100644 index 00000000..2851b54a --- /dev/null +++ b/project/Projects/Presentation/DSKit/Resources/Icons.xcassets/plus.imageset/plus.svg @@ -0,0 +1,4 @@ + + + + diff --git a/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/IdleFloatingButton.swift b/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/IdleFloatingButton.swift new file mode 100644 index 00000000..9e833714 --- /dev/null +++ b/project/Projects/Presentation/DSKit/Sources/CommonUI/Button/IdleFloatingButton.swift @@ -0,0 +1,90 @@ +// +// IdleFloatingButton.swift +// DSKit +// +// Created by choijunios on 8/29/24. +// + +import UIKit +import RxSwift +import RxCocoa + +public class IdleFloatingButton: TappableUIView { + + // Init + + // View + public let imageView: UIImageView = { + let view = UIImageView() + view.image = DSIcon.plus.image + return view + }() + public let label: IdleLabel = { + let label = IdleLabel(typography: .Subtitle3) + label.attrTextColor = DSColor.gray0.color + return label + }() + + private let disposeBag = DisposeBag() + + public init(labelText: String) { + self.label.textString = labelText + super.init() + + setApearance() + setAutoLayout() + setObservable() + } + + required init?(coder: NSCoder) { fatalError() } + + public override func layoutSubviews() { + super.layoutSubviews() + let hegiht = self.bounds.height + self.layer.cornerRadius = hegiht/2 + } + + private func setApearance() { + // InitialSetting + self.backgroundColor = DSColor.gray700.color + } + + private func setAutoLayout() { + self.layoutMargins = .init(top: 8, left: 16, bottom: 8, right: 16) + let contentStack = HStack([ + imageView, label + ], spacing: 6, alignment: .center) + [ + contentStack + ].forEach { + $0.translatesAutoresizingMaskIntoConstraints = false + self.addSubview($0) + } + + NSLayoutConstraint.activate([ + contentStack.topAnchor.constraint(equalTo: self.layoutMarginsGuide.topAnchor), + contentStack.leftAnchor.constraint(equalTo: self.layoutMarginsGuide.leftAnchor), + contentStack.rightAnchor.constraint(equalTo: self.layoutMarginsGuide.rightAnchor), + contentStack.bottomAnchor.constraint(equalTo: self.layoutMarginsGuide.bottomAnchor), + ]) + } + + private func setObservable() { + + self.rx.tap + .subscribe { [weak self] _ in + guard let self else { return } + self.alpha = 0.7 + UIView.animate(withDuration: 0.3) { + self.alpha = 1 + } + } + .disposed(by: disposeBag) + } +} + +@available(iOS 17.0, *) +#Preview("Preview", traits: .defaultLayout) { + + IdleFloatingButton(labelText: "공고 등록") +} diff --git a/project/Projects/Presentation/DSKit/Sources/CommonUI/Card/Post/Worker/WorkerEmployCard.swift b/project/Projects/Presentation/DSKit/Sources/CommonUI/Card/Post/Worker/WorkerEmployCard.swift index ad046f21..3ab19f13 100644 --- a/project/Projects/Presentation/DSKit/Sources/CommonUI/Card/Post/Worker/WorkerEmployCard.swift +++ b/project/Projects/Presentation/DSKit/Sources/CommonUI/Card/Post/Worker/WorkerEmployCard.swift @@ -184,10 +184,11 @@ public class WorkerEmployCard: UIView { let tagStarStack = HStack( [ tagStack, + Spacer(), starButton ], alignment: .center, - distribution: .equalSpacing + distribution: .fill ) tagStack.setContentHuggingPriority(.defaultLow, for: .horizontal) starButton.setContentHuggingPriority(.defaultHigh, for: .horizontal) diff --git a/project/Projects/Presentation/Feature/Base/Sources/View/View/RecruitmentPost/Center/Edit/ApplicationDetailViewContentView.swift b/project/Projects/Presentation/Feature/Base/Sources/View/View/RecruitmentPost/Center/Edit/ApplicationDetailViewContentView.swift index 8d4cb47a..30e5de63 100644 --- a/project/Projects/Presentation/Feature/Base/Sources/View/View/RecruitmentPost/Center/Edit/ApplicationDetailViewContentView.swift +++ b/project/Projects/Presentation/Feature/Base/Sources/View/View/RecruitmentPost/Center/Edit/ApplicationDetailViewContentView.swift @@ -43,7 +43,7 @@ public class ApplicationDetailViewContentView: UIView { // 지원 방법 let applyTypeButtons: [StateButtonTyp1] = { - ApplyType.allCases.map { type in + [ApplyType.phoneCall, ApplyType.app].map { type in StateButtonTyp1( text: type.korTextForBtn, initial: .normal @@ -234,8 +234,8 @@ public class ApplicationDetailViewContentView: UIView { // 마감기간 if let state = stateFromVM.deadlineDate { - calendarOpenButton - .textLabel.textString = state.convertDateToString() + calendarOpenButton.textLabel.textString = state.convertDateToString() + calendarOpenButton.textLabel.attrTextColor = DSColor.gray900.color } }) @@ -326,6 +326,7 @@ public class ApplicationDetailViewContentView: UIView { extension ApplicationDetailViewContentView: OneDayPickerDelegate { public func oneDayPicker(selectedDate: Date) { + // 위임자 패턴으로 데이터를 수신 deadlineDate.accept(selectedDate) } diff --git a/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/CenterRecruitmentPostBoardScreenCoordinator.swift b/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/CenterRecruitmentPostBoardScreenCoordinator.swift index 8196bd12..e548bd84 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/CenterRecruitmentPostBoardScreenCoordinator.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/CenterRecruitmentPostBoardScreenCoordinator.swift @@ -65,5 +65,9 @@ public class CenterRecruitmentPostBoardScreenCoordinator: ChildCoordinator { public func showEditScreen(postId: String) { parent?.showEditScreen(postId: postId) } + + public func showRegisterPostScreen() { + parent?.showRegisterPostScrean() + } } diff --git a/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/RegisterCompleteCoordinator.swift b/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/RegisterCompleteCoordinator.swift index e7014810..e068352a 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/RegisterCompleteCoordinator.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/RegisterCompleteCoordinator.swift @@ -29,7 +29,7 @@ public class RegisterCompleteCoordinator: ChildCoordinator { } public func start() { - let vc = RegisterCompleteVC() + let vc = PostRegisterCompleteVC() vc.coordinator = self viewControllerRef = vc navigationController.pushViewController(vc, animated: true) diff --git a/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/RegisterRecruitmentPostCoordinator.swift b/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/RegisterRecruitmentPostCoordinator.swift index bb0a87db..4a7c6cbf 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/RegisterRecruitmentPostCoordinator.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/Coordinator/RecruitmentPost/RegisterRecruitmentPostCoordinator.swift @@ -43,10 +43,14 @@ public class RegisterRecruitmentPostCoordinator: RegisterRecruitmentPostCoordina public func start() { let vc = RegisterRecruitmentPostVC() - vc.bind(viewModel: registerRecruitmentPostVM) - viewControllerRef = vc - navigationController.pushViewController(vc, animated: true) + + let coordinator = CoordinatorWrapper( + parent: self, + nav: navigationController, + vc: vc + ) + coordinator.start() } } diff --git a/project/Projects/Presentation/Feature/Center/Sources/Coordinator/Setting/CenterSettingScreenCoordinator.swift b/project/Projects/Presentation/Feature/Center/Sources/Coordinator/Setting/CenterSettingScreenCoordinator.swift index cf5c6e39..238afc04 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/Coordinator/Setting/CenterSettingScreenCoordinator.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/Coordinator/Setting/CenterSettingScreenCoordinator.swift @@ -15,28 +15,24 @@ public class CenterSettingScreenCoordinator: ChildCoordinator { public struct Dependency { let navigationController: UINavigationController let settingUseCase: SettingScreenUseCase - let centerProfileUseCase: CenterProfileUseCase - public init(navigationController: UINavigationController, settingUseCase: SettingScreenUseCase, centerProfileUseCase: CenterProfileUseCase) { + public init(navigationController: UINavigationController, settingUseCase: SettingScreenUseCase) { self.navigationController = navigationController self.settingUseCase = settingUseCase - self.centerProfileUseCase = centerProfileUseCase } } public weak var viewControllerRef: UIViewController? - public weak var parent: CenterSettingScreenCoordinatable? + public weak var parent: CenterSettingCoordinatable? public let navigationController: UINavigationController let settingUseCase: SettingScreenUseCase - let centerProfileUseCase: CenterProfileUseCase public init( dependency: Dependency ) { self.navigationController = dependency.navigationController self.settingUseCase = dependency.settingUseCase - self.centerProfileUseCase = dependency.centerProfileUseCase } deinit { @@ -47,8 +43,7 @@ public class CenterSettingScreenCoordinator: ChildCoordinator { let vc = CenterSettingVC() let vm = CenterSettingVM( coordinator: self, - settingUseCase: settingUseCase, - centerProfileUseCase: centerProfileUseCase + settingUseCase: settingUseCase ) vc.bind(viewModel: vm) viewControllerRef = vc @@ -69,5 +64,9 @@ public class CenterSettingScreenCoordinator: ChildCoordinator { public func startRemoveCenterAccountFlow() { parent?.startRemoveCenterAccountFlow() } + + public func showMyCenterProfile() { + parent?.showMyCenterProfile() + } } diff --git a/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Board/Post/SubVC/OnGoingPostVC.swift b/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Board/Post/SubVC/OnGoingPostVC.swift index 03069c5a..e309b2f1 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Board/Post/SubVC/OnGoingPostVC.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Board/Post/SubVC/OnGoingPostVC.swift @@ -19,6 +19,7 @@ public protocol OnGoingPostViewModelable { var showRemovePostAlert: Driver? { get } var requestOngoingPost: PublishRelay { get } + var registerPostButtonClicked: PublishRelay { get } func createOngoingPostCellVM(postInfo: RecruitmentPostInfoForCenterVO) -> CenterEmployCardViewModelable } @@ -33,6 +34,11 @@ public class OnGoingPostVC: BaseViewController { let postTableView: UITableView = .init() let tableHeader = BoardSortigHeaderView() + let registerPostButton: IdleFloatingButton = { + let button = IdleFloatingButton(labelText: "공고 등록") + return button + }() + // DataSource private var postData: [RecruitmentPostInfoForCenterVO] = [] @@ -77,7 +83,8 @@ public class OnGoingPostVC: BaseViewController { private func setLayout() { [ - postTableView + postTableView, + registerPostButton ].forEach { $0.translatesAutoresizingMaskIntoConstraints = false view.addSubview($0) @@ -88,6 +95,9 @@ public class OnGoingPostVC: BaseViewController { postTableView.leftAnchor.constraint(equalTo: view.leftAnchor), postTableView.rightAnchor.constraint(equalTo: view.rightAnchor), postTableView.bottomAnchor.constraint(equalTo: view.bottomAnchor), + + registerPostButton.rightAnchor.constraint(equalTo: view.rightAnchor, constant: -16), + registerPostButton.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: -16) ]) } @@ -123,6 +133,12 @@ public class OnGoingPostVC: BaseViewController { .map { _ in } .bind(to: viewModel.requestOngoingPost) .disposed(by: disposeBag) + + registerPostButton + .rx.tap + .bind(to: viewModel.registerPostButtonClicked) + .disposed(by: disposeBag) + } } @@ -146,4 +162,19 @@ extension OnGoingPostVC: UITableViewDataSource, UITableViewDelegate { return cell } + + public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { + if registerPostButton.alpha != 0 { + UIView.animate(withDuration: 0.1) { + self.registerPostButton.alpha = 0.5 + } + } + } + public func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { + if registerPostButton.alpha != 1 { + UIView.animate(withDuration: 0.1) { + self.registerPostButton.alpha = 1 + } + } + } } diff --git a/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Register/RegisterCompleteScreen/RegisterCompleteVC.swift b/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Register/PostRegisterCompleteScreen/PostRegisterCompleteVC.swift similarity index 97% rename from project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Register/RegisterCompleteScreen/RegisterCompleteVC.swift rename to project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Register/PostRegisterCompleteScreen/PostRegisterCompleteVC.swift index 8db3891c..fa54ec6d 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Register/RegisterCompleteScreen/RegisterCompleteVC.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/View/RecruitmentPost/Register/PostRegisterCompleteScreen/PostRegisterCompleteVC.swift @@ -1,5 +1,5 @@ // -// RegisterCompleteVC.swift +// PostRegisterCompleteVC.swift // CenterFeature // // Created by choijunios on 8/6/24. @@ -13,7 +13,7 @@ import RxSwift import Entity import DSKit -public class RegisterCompleteVC: BaseViewController { +public class PostRegisterCompleteVC: BaseViewController { // Init diff --git a/project/Projects/Presentation/Feature/Center/Sources/View/Setting/CenterSettingVC.swift b/project/Projects/Presentation/Feature/Center/Sources/View/Setting/CenterSettingVC.swift index 98b19f48..d7096a3b 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/View/Setting/CenterSettingVC.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/View/Setting/CenterSettingVC.swift @@ -79,6 +79,11 @@ public class CenterSettingVC: BaseViewController { self.viewModel = viewModel // Input + rx.viewWillAppear + .map { _ in () } + .bind(to: viewModel.viewWillAppear) + .disposed(by: disposeBag) + Observable.merge( myCenterInfoButton.rx.tap.asObservable(), centerInfoCard.rx.tap.asObservable() diff --git a/project/Projects/Presentation/Feature/Center/Sources/ViewModel/RecruitmentPost/CenterRecruitmentPostBoardVM.swift b/project/Projects/Presentation/Feature/Center/Sources/ViewModel/RecruitmentPost/CenterRecruitmentPostBoardVM.swift index f36c79bb..b15f1528 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/ViewModel/RecruitmentPost/CenterRecruitmentPostBoardVM.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/ViewModel/RecruitmentPost/CenterRecruitmentPostBoardVM.swift @@ -28,6 +28,7 @@ public class CenterRecruitmentPostBoardVM: CenterRecruitmentPostBoardViewModelab public var requestOngoingPost: PublishRelay = .init() public var requestClosedPost: PublishRelay = .init() + public var registerPostButtonClicked: RxRelay.PublishRelay = .init() public var ongoingPostInfo: RxCocoa.Driver<[Entity.RecruitmentPostInfoForCenterVO]>? public var closedPostInfo: RxCocoa.Driver<[Entity.RecruitmentPostInfoForCenterVO]>? @@ -107,6 +108,13 @@ public class CenterRecruitmentPostBoardVM: CenterRecruitmentPostBoardViewModelab let closePostFailure = closePostResult.compactMap { $0.error } + // 공고등록버튼 + registerPostButtonClicked + .subscribe(onNext: { [weak self] _ in + self?.coordinator?.showRegisterPostScreen() + }) + .disposed(by: disposeBag) + alert = Observable.merge( requestOngoingPostFailure, requestClosedPostFailure, @@ -221,9 +229,8 @@ class CenterEmployCardVM: CenterEmployCardViewModelable { terminatePostBtnClicked - .subscribe(onNext: { [weak self] _ in - guard let self else { return } - + .subscribe(onNext: { _ in + NotificationCenter.default.post( name: .removePostRequestFromCell, object: [ diff --git a/project/Projects/Presentation/Feature/Center/Sources/ViewModel/Setting/CenterSettingVM.swift b/project/Projects/Presentation/Feature/Center/Sources/ViewModel/Setting/CenterSettingVM.swift index a92db919..94214cb7 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/ViewModel/Setting/CenterSettingVM.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/ViewModel/Setting/CenterSettingVM.swift @@ -40,7 +40,6 @@ public class CenterSettingVM: CenterSettingVMable { // Init weak var coordinator: CenterSettingScreenCoordinator? let settingUseCase: SettingScreenUseCase - let centerProfileUseCase: CenterProfileUseCase public var viewWillAppear: RxRelay.PublishRelay = .init() public var myCenterProfileButtonClicked: RxRelay.PublishRelay = .init() @@ -58,13 +57,11 @@ public class CenterSettingVM: CenterSettingVMable { public init( coordinator: CenterSettingScreenCoordinator?, - settingUseCase: SettingScreenUseCase, - centerProfileUseCase: CenterProfileUseCase + settingUseCase: SettingScreenUseCase ) { self.coordinator = coordinator self.settingUseCase = settingUseCase - self.centerProfileUseCase = centerProfileUseCase // 기존의 알람수신 동의 여부 확인 @@ -115,22 +112,22 @@ public class CenterSettingVM: CenterSettingVMable { // MARK: 센터카드 정보 알아내기 - let fetchCenterProfileResult = viewWillAppear - .flatMap { [centerProfileUseCase] _ in - centerProfileUseCase.getProfile(mode: .myProfile) - } - - let fetchCenterProfileSuccess = fetchCenterProfileResult.compactMap { $0.value } - let fetchCenterProfileFailure = fetchCenterProfileResult.compactMap { $0.error } - - centerInfo = fetchCenterProfileSuccess + centerInfo = viewWillAppear .map { centerProfileVO in - ( - centerProfileVO.centerName, - centerProfileVO.roadNameAddress - ) + let vo = settingUseCase.getCenterProfile() + return (vo.centerName, vo.roadNameAddress) } .asDriver(onErrorJustReturn: ("재가요양센터", "대한민국")) + + + // MARK: 센터 정보로 이동하기 + myCenterProfileButtonClicked + .subscribe(onNext: { [weak self] _ in + guard let self else { return } + self.coordinator?.showMyCenterProfile() + }) + .disposed(by: disposeBag) + // MARK: 로그아웃 let signOutRequestResult = signOutButtonComfirmed.flatMap({ [settingUseCase] _ in @@ -163,7 +160,6 @@ public class CenterSettingVM: CenterSettingVMable { // MARK: Alert alert = Observable.merge( approveRequestError.map { _ in "알람수신 동의 실패" }, - fetchCenterProfileFailure.map { $0.message }, signOutFailure.map { $0.message } ) .map({ message in diff --git a/project/Projects/Presentation/Feature/Center/Sources/ViewModel/Setting/PasswordForDeregisterVM.swift b/project/Projects/Presentation/Feature/Center/Sources/ViewModel/Setting/PasswordForDeregisterVM.swift index 12f98c74..e0307330 100644 --- a/project/Projects/Presentation/Feature/Center/Sources/ViewModel/Setting/PasswordForDeregisterVM.swift +++ b/project/Projects/Presentation/Feature/Center/Sources/ViewModel/Setting/PasswordForDeregisterVM.swift @@ -45,8 +45,6 @@ public class PasswordForDeregisterVM: DefaultAlertOutputable { .observe(on: MainScheduler.asyncInstance) .subscribe(onNext: { [weak self] _ in - // ‼️ ‼️ 로컬에 저장된 계정 정보 삭제 ‼️ ‼️ - // RootCoordinator로 이동 self?.coordinator?.popToRoot() }) diff --git a/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/CoordinatorWrapper.swift b/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/CoordinatorWrapper.swift new file mode 100644 index 00000000..c931a0cb --- /dev/null +++ b/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/CoordinatorWrapper.swift @@ -0,0 +1,43 @@ +// +// CoordinatorWrapper.swift +// PresentationCore +// +// Created by choijunios on 8/29/24. +// + +import UIKit +import Entity + +public class CoordinatorWrapper: ChildCoordinator { + + public weak var viewControllerRef: UIViewController? + public weak var parent: ParentCoordinator? + + public let navigationController: UINavigationController + + let animated: Bool + + public init( + parent: ParentCoordinator, + nav: UINavigationController, + vc: UIViewController, + animated: Bool = true + ) { + self.parent = parent + self.navigationController = nav + self.viewControllerRef = vc + self.animated = animated + + parent.addChildCoordinator(self) + } + + public func start() { + navigationController.pushViewController(viewControllerRef!, animated: animated) + } + + public func coordinatorDidFinish() { + popViewController() + parent?.removeChildCoordinator(self) + } +} + diff --git a/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/RecruitmentPost/Center/RecruitmentManagementCoordinatable.swift b/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/RecruitmentPost/Center/RecruitmentManagementCoordinatable.swift index fd5de76a..af74d08f 100644 --- a/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/RecruitmentPost/Center/RecruitmentManagementCoordinatable.swift +++ b/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/RecruitmentPost/Center/RecruitmentManagementCoordinatable.swift @@ -12,4 +12,5 @@ public protocol RecruitmentManagementCoordinatable: ParentCoordinator { func showCheckingApplicantScreen(postId: String) func showPostDetailScreenForCenter(postId: String, postState: PostState) func showEditScreen(postId: String) + func showRegisterPostScrean() } diff --git a/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/Setting/CenterSettingScreenCoordinatable.swift b/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/Setting/CenterSettingCoordinatable.swift similarity index 51% rename from project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/Setting/CenterSettingScreenCoordinatable.swift rename to project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/Setting/CenterSettingCoordinatable.swift index 7c85b61c..f982d60a 100644 --- a/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/Setting/CenterSettingScreenCoordinatable.swift +++ b/project/Projects/Presentation/PresentationCore/Sources/ScreenCoordinating/Interface/Setting/CenterSettingCoordinatable.swift @@ -1,5 +1,5 @@ // -// CenterSettingScreenCoordinatable.swift +// CenterSettingCoordinatable.swift // PresentationCore // // Created by choijunios on 8/25/24. @@ -7,7 +7,10 @@ import Foundation -public protocol CenterSettingScreenCoordinatable: ParentCoordinator { +public protocol CenterSettingCoordinatable: ParentCoordinator { /// 시설 관리자 계정을 지우는 작업을 시작합니다. func startRemoveCenterAccountFlow() + + /// 현재 센터 프로필을 표시합니다. + func showMyCenterProfile() }