From 4176bc9113a6336c792bf29daa017aac23fd0a11 Mon Sep 17 00:00:00 2001 From: Safari <91936941+Siwon-L@users.noreply.github.com> Date: Fri, 20 Dec 2024 12:18:25 +0900 Subject: [PATCH] =?UTF-8?q?[D-0]=20Hotfix=20=EC=86=8C=EC=86=8D=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1=20=ED=99=94=EB=A9=B4=20=EC=9D=BC=EB=B6=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(#85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: SegmentControl 순서 변경 * fix: button action이 tapGesture과 겹치는 문제 수정 * fix: 버튼 레이아웃 수정 --- .../Demo/Sources/SceneDelegate.swift | 2 +- .../InputAgencyInfoReactor.swift | 6 +++--- .../InputAgencyInfo/InputAgencyInfoVC.swift | 19 +++++++++++++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/Projects/Feature/CreateAgency/Demo/Sources/SceneDelegate.swift b/Projects/Feature/CreateAgency/Demo/Sources/SceneDelegate.swift index 08b5b5f..0398668 100644 --- a/Projects/Feature/CreateAgency/Demo/Sources/SceneDelegate.swift +++ b/Projects/Feature/CreateAgency/Demo/Sources/SceneDelegate.swift @@ -12,7 +12,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { let networkManager = NetworkManager() let localStorage = LocalStorage() - window?.rootViewController = UINavigationController(rootViewController: InputUniversityInfoFactory(networkManager: networkManager, localStorage: localStorage).make(coordinator: nil, agencyName: "", agencyType: .inSchoolClub)) + window?.rootViewController = UINavigationController(rootViewController: InputAgencyInfoFactory(networkManager: networkManager, localStorage: localStorage).make(coordinator: nil, universityType: .unknown)) window?.makeKeyAndVisible() } diff --git a/Projects/Feature/CreateAgency/Sources/Scene/InputAgencyInfo/InputAgencyInfoReactor.swift b/Projects/Feature/CreateAgency/Sources/Scene/InputAgencyInfo/InputAgencyInfoReactor.swift index 16f7280..d7dfecf 100644 --- a/Projects/Feature/CreateAgency/Sources/Scene/InputAgencyInfo/InputAgencyInfoReactor.swift +++ b/Projects/Feature/CreateAgency/Sources/Scene/InputAgencyInfo/InputAgencyInfoReactor.swift @@ -121,9 +121,9 @@ public final class InputAgencyInfoReactor: Reactor { extension InputAgencyInfoReactor { func parsingAgencyType(with selectedIndex: Int) -> AgencyType? { switch selectedIndex { - case 0: .inSchoolClub - case 1: .studentCouncil - case 2: .general + case 0: .general + case 1: .inSchoolClub + case 2: .studentCouncil default: nil } } diff --git a/Projects/Feature/CreateAgency/Sources/Scene/InputAgencyInfo/InputAgencyInfoVC.swift b/Projects/Feature/CreateAgency/Sources/Scene/InputAgencyInfo/InputAgencyInfoVC.swift index 5f20b21..cd3c87e 100644 --- a/Projects/Feature/CreateAgency/Sources/Scene/InputAgencyInfo/InputAgencyInfoVC.swift +++ b/Projects/Feature/CreateAgency/Sources/Scene/InputAgencyInfo/InputAgencyInfoVC.swift @@ -48,7 +48,7 @@ public final class InputAgencyInfoVC: BaseVC, View { }() private let agencySegmentControl: MMSegmentControl = { - let v = MMSegmentControl(titles: ["동아리", "학생회", "기타모임"], type: .round) + let v = MMSegmentControl(titles: [ "기타모임", "동아리", "학생회"], type: .round) v.selectedIndex = 0 return v }() @@ -105,8 +105,8 @@ public final class InputAgencyInfoVC: BaseVC, View { keybordShowCreateButtonConstraints = [ registerButton.heightAnchor.constraint(equalToConstant: 56), registerButton.bottomAnchor.constraint(equalTo: view.keyboardLayoutGuide.topAnchor), - registerButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: 3), - registerButton.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: -3) + registerButton.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: 12), + registerButton.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: -12) ] NSLayoutConstraint.activate(keybordHideCreateButtonConstraints) @@ -159,7 +159,7 @@ public final class InputAgencyInfoVC: BaseVC, View { } .disposed(by: disposeBag) - view.rx.tapGesture + rootContainer.rx.tapGesture .bind { $0.endEditing(true) } .disposed(by: disposeBag) @@ -197,8 +197,8 @@ public final class InputAgencyInfoVC: BaseVC, View { .filter { $0 == .none} .observe(on: MainScheduler.instance) .bind(with: self) { owner, _ in - owner.agencySegmentControl.selectedIndex = 2 - owner.agencySegmentControl.disableButtons(with: 0,1) + owner.agencySegmentControl.selectedIndex = 0 + owner.agencySegmentControl.disableButtons(with: 1,2) owner.agencySegmentControl.flex.layout() } .disposed(by: disposeBag) @@ -243,5 +243,12 @@ public final class InputAgencyInfoVC: BaseVC, View { reactor.pulse(\.$isLoading) .bind(to: rx.isLoading) .disposed(by: disposeBag) + + reactor.pulse(\.$agencyType) + .map { $0 == .general ? "등록하기" : "다음으로" } + .bind(with: self) { owner, title in + owner.registerButton.setTitle(to: title) + } + .disposed(by: disposeBag) } }