From c17ef6d8286fbfe4d74fdad791f101eff0b5b78f Mon Sep 17 00:00:00 2001 From: yeahzxnn Date: Thu, 15 Feb 2024 19:57:54 +0900 Subject: [PATCH] =?UTF-8?q?fix=20:=20InsertWorklogView=20=EB=9C=A8?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/Base/View/HomeViewController.swift | 5 ++-- .../Home/On/Worklog/Model/Worklog.swift | 1 - .../Home/On/Worklog/View/OnUIView.swift | 29 +++++-------------- .../On/Worklog/ViewModel/OnUIViewModel.swift | 6 ++-- 4 files changed, 12 insertions(+), 29 deletions(-) diff --git a/On_off_iOS/On_off_iOS/Home/Base/View/HomeViewController.swift b/On_off_iOS/On_off_iOS/Home/Base/View/HomeViewController.swift index d9ca995..5d0f2be 100644 --- a/On_off_iOS/On_off_iOS/Home/Base/View/HomeViewController.swift +++ b/On_off_iOS/On_off_iOS/Home/Base/View/HomeViewController.swift @@ -101,7 +101,6 @@ final class HomeViewController: UIViewController { addBaseSubViews() bind() - print("\(OnUIView.self) 화면에 좀 떠주라...제발...나 시간이 없어...") } override func viewDidLayoutSubviews() { @@ -305,7 +304,7 @@ final class HomeViewController: UIViewController { /// 피드 추가 버튼 private func bindAddWorkLogButton() { - OnUIView().clickedAddWorklogButton + onUIView.clickedAddWorklogButton .bind { [weak self] in guard let self = self else { return } presentInsertWorkLogView(insertFeed: nil) @@ -315,7 +314,7 @@ final class HomeViewController: UIViewController { /// Worklog 클릭한 경우 private func bindSelectedFeedTableViewCell() { - OnUIView().selectedWorklogTableViewCell + onUIView.selectedWorklogTableViewCell .bind { [weak self] Worklog in guard let self = self else { return } let ClickWorklogView = ClickWorklogView() diff --git a/On_off_iOS/On_off_iOS/Home/On/Worklog/Model/Worklog.swift b/On_off_iOS/On_off_iOS/Home/On/Worklog/Model/Worklog.swift index acd7b7d..11f320f 100644 --- a/On_off_iOS/On_off_iOS/Home/On/Worklog/Model/Worklog.swift +++ b/On_off_iOS/On_off_iOS/Home/On/Worklog/Model/Worklog.swift @@ -12,7 +12,6 @@ struct Worklog: Codable { let content: String? let isChecked: Bool? let date: String? - let createdAt: String? } struct AddWorklog: Codable { diff --git a/On_off_iOS/On_off_iOS/Home/On/Worklog/View/OnUIView.swift b/On_off_iOS/On_off_iOS/Home/On/Worklog/View/OnUIView.swift index 154f126..cce2362 100644 --- a/On_off_iOS/On_off_iOS/Home/On/Worklog/View/OnUIView.swift +++ b/On_off_iOS/On_off_iOS/Home/On/Worklog/View/OnUIView.swift @@ -125,25 +125,11 @@ final class OnUIView: UIView { scrollView.addSubview(contentView) contentView.addSubview(feedlabelBackgroundUIView) contentView.addSubview(feedTitleButton) - feedlabelBackgroundUIView.addSubview(feedPlusIconImageButton) // 버튼을 상위 뷰에 추가 - - // 상위 뷰의 사용자 상호 작용 가능 설정 - feedlabelBackgroundUIView.isUserInteractionEnabled = true - + feedlabelBackgroundUIView.addSubview(feedPlusIconImageButton) contentView.addSubview(feedUITableView) contentView.addSubview(dateLabel) constraints(output: output) - - // 버튼의 클릭 이벤트 처리 - feedPlusIconImageButton.rx.tap - .bind { [weak self] in - guard let self = self else { return } - print("feedPlusIconImageButton tapped") // 버튼이 눌렸을 때 메시지를 출력하여 확인 - // 추가로 필요한 작업 수행 - } - .disposed(by: disposeBag) - } @@ -159,7 +145,6 @@ final class OnUIView: UIView { // make.trailing.equalTo(scrollView.snp.trailing) //// make.bottom.equalTo(scrollView.snp.bottom) // make.width.equalTo(scrollView.snp.width) - // make.height.equalTo(1000) make.edges.equalToSuperview() make.height.equalTo(1000) make.width.equalTo(scrollView.snp.width) @@ -215,15 +200,15 @@ final class OnUIView: UIView { // Worklog 제목 버튼 및 이미지 버튼 private func bindFeedEvents() { - feedTitleButton.rx.tap - .bind { [weak self] in + feedPlusIconImageButton.rx.tap + .subscribe(onNext: { [weak self] in guard let self = self else { return } - print("Button tapped") // Add this line for debugging - clickedAddWorklogButton.onNext(()) - } + print("Button tapped") + self.clickedAddWorklogButton.onNext(()) + }) .disposed(by: disposeBag) } - + /// Binding Work log Table View private func bindTableViewHeight(output: OnUIViewModel.Output) { output.workLogRelay diff --git a/On_off_iOS/On_off_iOS/Home/On/Worklog/ViewModel/OnUIViewModel.swift b/On_off_iOS/On_off_iOS/Home/On/Worklog/ViewModel/OnUIViewModel.swift index 18d018a..2af7eaf 100644 --- a/On_off_iOS/On_off_iOS/Home/On/Worklog/ViewModel/OnUIViewModel.swift +++ b/On_off_iOS/On_off_iOS/Home/On/Worklog/ViewModel/OnUIViewModel.swift @@ -44,7 +44,7 @@ final class OnUIViewModel { return output } - + /// Binding Load W.L. private func bindLoadWLFeed(input: Input, output: Output) { input.loadWLFeed? @@ -71,7 +71,7 @@ final class OnUIViewModel { } .disposed(by: disposeBag) } - + /// Binding Selected W.L private func bindSelectedWLFeed(input: Input, output: Output) { input.clickCheckMarkOfWLFeed? @@ -105,7 +105,7 @@ final class OnUIViewModel { .disposed(by: disposeBag) } - + /// 업무일지 체크 유무 /// - Parameters: /// - worklogId: Worklog Id