Skip to content

Commit

Permalink
fix/#358 준비 정보 수정 페이지 연결
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaybei committed Sep 2, 2024
1 parent 90d7b06 commit bae56e1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ReadyPlanInfoView: BaseView {
$0.setText("이동 소요 시간: 1시간 30분", style: .label02, color: .gray8)
}

private let editButton: UIButton = UIButton().then {
let editButton: UIButton = UIButton().then {
$0.setTitle("수정", style: .caption01, color: .gray6)
$0.backgroundColor = .gray0
$0.layer.cornerRadius = Screen.height(28) / 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class ReadyStatusViewController: BaseViewController {
action: #selector(arrivalButtonDidTap),
for: .touchUpInside
)
rootView.readyPlanInfoView.editButton.addTarget(
self,
action: #selector(editReadyButtonDidTap),
for: .touchUpInside
)
rootView.enterReadyButtonView.addGestureRecognizer(
UITapGestureRecognizer(
target: self,
Expand Down Expand Up @@ -437,6 +442,26 @@ extension ReadyStatusViewController {
rootView.myReadyStatusProgressView.arrivalButton.isEnabled = false
}

@objc
func editReadyButtonDidTap() {
guard let _ = viewModel.promiseInfo.value?.promiseName else { return }
guard let readyStatusInfo = viewModel.myReadyStatus.value else { return }

let setReadyInfoViewController = SetReadyInfoViewController(
viewModel: SetReadyInfoViewModel(
promiseID: viewModel.promiseID,
promiseTime: readyStatusInfo.promiseTime,
promiseName: viewModel.promiseInfo.value?.promiseName ?? "",
service: PromiseService()
)
)

navigationController?.pushViewController(
setReadyInfoViewController,
animated: true
)
}

@objc
func enterReadyButtonDidTap() {
guard let _ = viewModel.promiseInfo.value?.promiseName else { return }
Expand Down

0 comments on commit bae56e1

Please sign in to comment.