Skip to content

Commit

Permalink
[D-0] Hotfix 소속 생성 화면 일부 수정 (#85)
Browse files Browse the repository at this point in the history
* fix: SegmentControl 순서 변경

* fix: button action이 tapGesture과 겹치는 문제 수정

* fix: 버튼 레이아웃 수정
  • Loading branch information
Siwon-L committed Dec 20, 2024
1 parent acf2129 commit 03aec83
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -243,5 +243,13 @@ public final class InputAgencyInfoVC: BaseVC, View {
reactor.pulse(\.$isLoading)
.bind(to: rx.isLoading)
.disposed(by: disposeBag)

reactor.pulse(\.$agencyType)
.filter { [weak reactor] _ in reactor?.currentState.universityType == .unknown }
.map { $0 == .general ? "등록하기" : "다음으로" }
.bind(with: self) { owner, title in
owner.registerButton.setTitle(to: title)
}
.disposed(by: disposeBag)
}
}

0 comments on commit 03aec83

Please sign in to comment.