From 7ffd398eab9e15d3bbb77d8eaa63d829e7bd6c09 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 18 Oct 2023 17:28:56 +0900 Subject: [PATCH 01/11] =?UTF-8?q?[Feat]=20#199=20-=20=EB=84=A4=EB=B9=84?= =?UTF-8?q?=EA=B2=8C=EC=9D=B4=EC=85=98=20=EB=B0=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Running/VC/RunningWaitingVC.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift index c5f95be7..13e6827a 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift @@ -17,6 +17,7 @@ final class RunningWaitingVC: UIViewController { private var courseId: Int? private var publicCourseId: Int? private var courseModel: Course? + private var courseTitle: String? private let courseProvider = Providers.courseProvider @@ -24,7 +25,7 @@ final class RunningWaitingVC: UIViewController { // MARK: - UI Components - private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton) + private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle(courseTitle!) private let mapView = RNMapView() @@ -72,9 +73,10 @@ final class RunningWaitingVC: UIViewController { // MARK: - Methods extension RunningWaitingVC { - func setData(courseId: Int, publicCourseId: Int?) { + func setData(courseId: Int, publicCourseId: Int?, courseTitle: String) { self.courseId = courseId self.publicCourseId = publicCourseId + self.courseTitle = courseTitle getCourseDetail(courseId: courseId) } @@ -140,7 +142,7 @@ extension RunningWaitingVC { view.bringSubviewToFront(naviBar) mapView.snp.makeConstraints { make in - make.edges.equalToSuperview() + make.edges.equalTo(view.safeAreaLayoutGuide) } distanceContainerView.snp.makeConstraints { make in From 8fdeb16977863bcbf089aa719531be6bc0e11626 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 18 Oct 2023 17:30:08 +0900 Subject: [PATCH 02/11] =?UTF-8?q?[Feat]=20#199=20-=20=EB=8D=94=EB=B3=B4?= =?UTF-8?q?=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 로직 연결 x --- .../Running/VC/RunningWaitingVC.swift | 107 +++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift index 13e6827a..ed91df74 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift @@ -9,6 +9,7 @@ import UIKit import NMapsMap import Moya +import DropDown final class RunningWaitingVC: UIViewController { @@ -27,6 +28,11 @@ final class RunningWaitingVC: UIViewController { private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle(courseTitle!) + private let moreButton = UIButton(type: .system).then { + $0.setImage(ImageLiterals.icMore, for: .normal) + $0.tintColor = .g1 + } + private let mapView = RNMapView() private let distanceLabel = UILabel().then { @@ -96,6 +102,7 @@ extension RunningWaitingVC { private func setAddTarget() { self.startButton.addTarget(self, action: #selector(startButtonDidTap), for: .touchUpInside) + moreButton.addTarget(self, action: #selector(moreButtonDidTap), for: .touchUpInside) } } @@ -117,6 +124,38 @@ extension RunningWaitingVC { countDownVC.setData(runningModel: runningModel) self.navigationController?.pushViewController(countDownVC, animated: true) } + + @objc private func moreButtonDidTap() { + guard let courseModel = self.courseModel else {return} + + let items = ["수정하기", "삭제하기"] + let imageArray: [UIImage] = [ImageLiterals.icModify, ImageLiterals.icRemove] + + let menu = DropDown().then { + $0.anchorView = moreButton + $0.backgroundColor = .w1 + $0.bottomOffset = CGPoint(x: -136, y: moreButton.bounds.height - 10) + $0.width = 170 + $0.cellHeight = 40 + $0.cornerRadius = 12 + $0.dismissMode = .onTap + $0.separatorColor = UIColor(hex: "#EBEBEB") + $0.dataSource = items + $0.textFont = .b3 + } + + menu.customCellConfiguration = { (index: Index, _: String, cell: DropDownCell) -> Void in + let lastDividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: 79), size: CGSize(width: 170, height: 10))) + lastDividerLineRemove.backgroundColor = .white + cell.separatorInset = .zero + cell.dropDownImage.image = imageArray[index] + cell.addSubview(lastDividerLineRemove) + } + + dropDownTouchAction(menu: menu, courseModel: courseModel) + + menu.show() + } } // MARK: - UI & Layout @@ -125,11 +164,11 @@ extension RunningWaitingVC { private func setUI() { self.view.backgroundColor = .w1 self.distanceContainerView.layer.applyShadow(alpha: 0.2, x: 2, y: 4, blur: 9) - self.naviBar.backgroundColor = .clear } private func setLayout() { view.addSubviews(naviBar, + moreButton, mapView, distanceContainerView, startButton) @@ -141,6 +180,12 @@ extension RunningWaitingVC { view.bringSubviewToFront(naviBar) + moreButton.snp.makeConstraints { make in + make.trailing.equalTo(self.view.safeAreaLayoutGuide) + make.centerY.equalTo(naviBar) + } + view.bringSubviewToFront(moreButton) + mapView.snp.makeConstraints { make in make.edges.equalTo(view.safeAreaLayoutGuide) } @@ -209,3 +254,63 @@ extension RunningWaitingVC { } } } + +// MARK: - DropDown + +extension RunningWaitingVC { + private func dropDownTouchAction(menu: DropDown, courseModel: Course) { + DropDown.appearance().textColor = .g1 + DropDown.appearance().selectionBackgroundColor = .w1 + DropDown.appearance().shadowColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.2) + DropDown.appearance().shadowOpacity = 1 + DropDown.appearance().shadowRadius = 10 + + menu.selectionAction = { [unowned self] (_, item) in + menu.clearSelection() + + switch item { + case "수정하기": + let bottomSheet = CustomBottomSheetVC() + self.navigationController?.pushViewController(bottomSheet, animated: false) + case "삭제하기": + let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") + deleteAlertVC.modalPresentationStyle = .overFullScreen + deleteAlertVC.rightButtonTapAction = { + deleteAlertVC.dismiss(animated: false) + self.deleteCourse() + self.navigationController?.popViewController(animated: true) + } + self.present(deleteAlertVC, animated: false) + default: + self.showToast(message: "없는 명령어 입니다.") + } + } + } +} + // MARK: - Network + +extension RunningWaitingVC { + private func deleteCourse() { + guard let courseId = self.courseId else { return } + LoadingIndicator.showLoading() + courseProvider.request(.deleteCourse(courseIdList: [courseId])) { [weak self] response in + LoadingIndicator.hideLoading() + guard let self = self else { return } + switch response { + case .success(let result): + print("리절트", result) + let status = result.statusCode + if 200..<300 ~= status { + print("삭제 성공") + } + if status >= 400 { + print("400 error") + self.showNetworkFailureToast() + } + case .failure(let error): + print(error.localizedDescription) + self.showNetworkFailureToast() + } + } + } +} From aac4ea986361046c9caa27d5fab81bc87ac14ab4 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 18 Oct 2023 17:30:52 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[Feat]=20#199=20-=20naviBar=EC=97=90=20?= =?UTF-8?q?=EC=BD=94=EC=8A=A4=20=EC=9D=B4=EB=A6=84=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/CourseStorage/VC/CourseStorageVC.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift index 6aa3809d..ca93caed 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift @@ -102,9 +102,10 @@ extension CourseStorageVC { privateCourseListView.cellDidTapped.sink { [weak self] index in guard let self = self else { return } let runningWaitingVC = RunningWaitingVC() - runningWaitingVC.setData(courseId: self.privateCourseList[index].id, publicCourseId: nil) - runningWaitingVC.hidesBottomBarWhenPushed = true + runningWaitingVC.setData(courseId: self.privateCourseList[index].id, publicCourseId: nil, courseTitle: self.privateCourseList[index].departure.city) + /// 코스 이름을 여기서 가져오는 로직 + runningWaitingVC.hidesBottomBarWhenPushed = true self.navigationController?.pushViewController(runningWaitingVC, animated: true) }.store(in: cancelBag) From d6d5e6e85a6f5d8ab08b99744f570289cb5a138b Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 18 Oct 2023 17:33:46 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[Feat]=20#199=20-=20Test=20Code=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift index ed91df74..4bee0715 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift @@ -26,7 +26,7 @@ final class RunningWaitingVC: UIViewController { // MARK: - UI Components - private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle(courseTitle!) + private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle(courseTitle ?? "Test Code") private let moreButton = UIButton(type: .system).then { $0.setImage(ImageLiterals.icMore, for: .normal) From a16246e4909fd598315240dde1561f3653d4a777 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Mon, 23 Oct 2023 21:20:21 +0900 Subject: [PATCH 05/11] =?UTF-8?q?[Style]=20#199=20-=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseStorage/VC/CourseStorageVC.swift | 2 +- .../Running/VC/RunningWaitingVC.swift | 55 ++++++++++--------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift index ca93caed..f57576f6 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift @@ -103,7 +103,7 @@ extension CourseStorageVC { guard let self = self else { return } let runningWaitingVC = RunningWaitingVC() runningWaitingVC.setData(courseId: self.privateCourseList[index].id, publicCourseId: nil, courseTitle: self.privateCourseList[index].departure.city) - /// 코스 이름을 여기서 가져오는 로직 + /// 코스 이름을 여기서 가져오는 로직 runningWaitingVC.hidesBottomBarWhenPushed = true self.navigationController?.pushViewController(runningWaitingVC, animated: true) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift index 4bee0715..1bea08d5 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift @@ -254,6 +254,33 @@ extension RunningWaitingVC { } } } + // MARK: - Network + +extension RunningWaitingVC { + private func deleteCourse() { + guard let courseId = self.courseId else { return } + LoadingIndicator.showLoading() + courseProvider.request(.deleteCourse(courseIdList: [courseId])) { [weak self] response in + LoadingIndicator.hideLoading() + guard let self = self else { return } + switch response { + case .success(let result): + print("리절트", result) + let status = result.statusCode + if 200..<300 ~= status { + print("삭제 성공") + } + if status >= 400 { + print("400 error") + self.showNetworkFailureToast() + } + case .failure(let error): + print(error.localizedDescription) + self.showNetworkFailureToast() + } + } + } +} // MARK: - DropDown @@ -271,6 +298,7 @@ extension RunningWaitingVC { switch item { case "수정하기": let bottomSheet = CustomBottomSheetVC() + // 현재 코스 모델의 이름 변경 self.navigationController?.pushViewController(bottomSheet, animated: false) case "삭제하기": let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") @@ -286,31 +314,4 @@ extension RunningWaitingVC { } } } -} - // MARK: - Network - -extension RunningWaitingVC { - private func deleteCourse() { - guard let courseId = self.courseId else { return } - LoadingIndicator.showLoading() - courseProvider.request(.deleteCourse(courseIdList: [courseId])) { [weak self] response in - LoadingIndicator.hideLoading() - guard let self = self else { return } - switch response { - case .success(let result): - print("리절트", result) - let status = result.statusCode - if 200..<300 ~= status { - print("삭제 성공") - } - if status >= 400 { - print("400 error") - self.showNetworkFailureToast() - } - case .failure(let error): - print(error.localizedDescription) - self.showNetworkFailureToast() - } - } - } } From 6544e3da16edf5e6ff1b35d30b4267cdcd9e4343 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Fri, 17 Nov 2023 23:43:43 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[Feat]=20#199=20-=20=EB=B0=94=ED=85=80=20?= =?UTF-8?q?=EC=8B=9C=ED=8A=B8=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 상세페이지에 시트를 추가 하였습니다. --- .../Presentation/Running/VC/RunningWaitingVC.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift index 1bea08d5..ab976a2b 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift @@ -297,9 +297,10 @@ extension RunningWaitingVC { switch item { case "수정하기": - let bottomSheet = CustomBottomSheetVC() // 현재 코스 모델의 이름 변경 - self.navigationController?.pushViewController(bottomSheet, animated: false) + let bottomSheetVC = CustomBottomSheetVC(type: .textField) + bottomSheetVC.modalPresentationStyle = .overFullScreen + self.present(bottomSheetVC, animated: false) case "삭제하기": let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") deleteAlertVC.modalPresentationStyle = .overFullScreen @@ -315,3 +316,5 @@ extension RunningWaitingVC { } } } + + From e041e2f22f3c66a9c27f00caca5712855d608b48 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Tue, 5 Dec 2023 13:52:56 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[Fix]=20#199=20-=20ScrapCourseResponseDto?= =?UTF-8?q?=20Codingkey=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 서버 요청 변수가 Scraps 에서 scraps 으로 변경 되었기 때문에 코드를 제거 합니다. --- .../CourseStorageDto/ResponseDto/ScrapCourseResponseDto.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Network/Dto/CourseStorageDto/ResponseDto/ScrapCourseResponseDto.swift b/Runnect-iOS/Runnect-iOS/Network/Dto/CourseStorageDto/ResponseDto/ScrapCourseResponseDto.swift index df79d112..5e1c9712 100644 --- a/Runnect-iOS/Runnect-iOS/Network/Dto/CourseStorageDto/ResponseDto/ScrapCourseResponseDto.swift +++ b/Runnect-iOS/Runnect-iOS/Network/Dto/CourseStorageDto/ResponseDto/ScrapCourseResponseDto.swift @@ -11,10 +11,6 @@ import Foundation struct ScrapCourseResponseDto: Codable { let scraps: [ScrapCourse] - - enum CodingKeys: String, CodingKey { - case scraps = "Scraps" - } } // MARK: - ScrapCourse From ac8976f70a8ea988cd0702dfc2413cfd474fe7c3 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Tue, 12 Dec 2023 23:24:14 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[Feat]=20#199=20-=20=EC=BD=94=EC=8A=A4=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=20Cell=EC=97=90=20=EB=93=B1=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj | 8 ++++---- .../CourseStorage/VC/CourseStorageVC.swift | 3 ++- .../CourseListView/PrivateCourseListView.swift | 15 +++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index cfc91627..5d8f478d 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -13,9 +13,9 @@ 23EE06C92AC1DED100CB3FF8 /* GesturePublisher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE06C82AC1DED100CB3FF8 /* GesturePublisher.swift */; }; 23EE06CB2AC2AF3E00CB3FF8 /* KakaoAddressSearchingResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE06CA2AC2AF3E00CB3FF8 /* KakaoAddressSearchingResponseDto.swift */; }; 23EE06D12AC2F44E00CB3FF8 /* TmapAddressSearchingResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23EE06D02AC2F44E00CB3FF8 /* TmapAddressSearchingResponseDto.swift */; }; + 71288ED82B289F5A00D6C921 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71288ED72B289F5A00D6C921 /* GoogleService-Info.plist */; }; 712F661D2A7B7BAB00D9539B /* Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = 712F661C2A7B7BAB00D9539B /* Config.swift */; }; 7136BF8A2AF921A900679364 /* CustomBottomSheetVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7136BF892AF921A900679364 /* CustomBottomSheetVC.swift */; }; - 71717B072B063E14004EA8DA /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 71DBF23D2ABB255A0013415B /* GoogleService-Info.plist */; }; A3305A97296EF58C000B1A10 /* GoalRewardInfoDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3305A96296EF58C000B1A10 /* GoalRewardInfoDto.swift */; }; A3BC2F2B2962C3D500198261 /* GoalRewardInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F2A2962C3D500198261 /* GoalRewardInfoVC.swift */; }; A3BC2F2D2962C3F200198261 /* ActivityRecordInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F2C2962C3F200198261 /* ActivityRecordInfoVC.swift */; }; @@ -175,9 +175,9 @@ 23EE06D02AC2F44E00CB3FF8 /* TmapAddressSearchingResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TmapAddressSearchingResponseDto.swift; sourceTree = ""; }; 3C3033C911343B5C57EB68E7 /* Pods-Runnect-iOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runnect-iOS.debug.xcconfig"; path = "Target Support Files/Pods-Runnect-iOS/Pods-Runnect-iOS.debug.xcconfig"; sourceTree = ""; }; 7110A6032AA337DD009A7E99 /* Runnect-iOSDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Runnect-iOSDebug.entitlements"; sourceTree = ""; }; + 71288ED72B289F5A00D6C921 /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 712F661C2A7B7BAB00D9539B /* Config.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Config.swift; sourceTree = ""; }; 7136BF892AF921A900679364 /* CustomBottomSheetVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomBottomSheetVC.swift; sourceTree = ""; }; - 71DBF23D2ABB255A0013415B /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../../Runnect-iOS/Runnect-iOS/Runnect-iOS/GoogleService-Info.plist"; sourceTree = ""; }; A3305A96296EF58C000B1A10 /* GoalRewardInfoDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalRewardInfoDto.swift; sourceTree = ""; }; A3BC2F2A2962C3D500198261 /* GoalRewardInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalRewardInfoVC.swift; sourceTree = ""; }; A3BC2F2C2962C3F200198261 /* ActivityRecordInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityRecordInfoVC.swift; sourceTree = ""; }; @@ -822,7 +822,7 @@ CE6655A9295D7FAA00C64E12 /* Network */, CE6655A8295D7F7D00C64E12 /* Presentation */, CE4545D6295D7AF5003201E1 /* Info.plist */, - 71DBF23D2ABB255A0013415B /* GoogleService-Info.plist */, + 71288ED72B289F5A00D6C921 /* GoogleService-Info.plist */, ); path = "Runnect-iOS"; sourceTree = ""; @@ -1274,7 +1274,7 @@ files = ( CE665615295D989A00C64E12 /* .swiftlint.yml in Resources */, CE17F0342961BEF800E1DED0 /* Pretendard-Bold.otf in Resources */, - 71717B072B063E14004EA8DA /* GoogleService-Info.plist in Resources */, + 71288ED82B289F5A00D6C921 /* GoogleService-Info.plist in Resources */, CE17F0352961BEF800E1DED0 /* Pretendard-SemiBold.otf in Resources */, CE17F0332961BEF800E1DED0 /* Pretendard-Medium.otf in Resources */, CE6655BF295D82E200C64E12 /* .gitkeep in Resources */, diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift index f57576f6..d7f81065 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift @@ -101,8 +101,9 @@ extension CourseStorageVC { privateCourseListView.cellDidTapped.sink { [weak self] index in guard let self = self else { return } + guard let title = self.privateCourseList[index].departure.name else {return} let runningWaitingVC = RunningWaitingVC() - runningWaitingVC.setData(courseId: self.privateCourseList[index].id, publicCourseId: nil, courseTitle: self.privateCourseList[index].departure.city) + runningWaitingVC.setData(courseId: self.privateCourseList[index].id, publicCourseId: nil, courseTitle: title) /// 코스 이름을 여기서 가져오는 로직 runningWaitingVC.hidesBottomBarWhenPushed = true diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift index 7106bb88..ee97f6dc 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/Views/CourseListView/PrivateCourseListView.swift @@ -192,18 +192,17 @@ extension PrivateCourseListView: UICollectionViewDelegate, UICollectionViewDataS } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CourseListCVC.className, for: indexPath) - as? CourseListCVC else { return UICollectionViewCell() } - cell.setCellType(type: .title) - if let selectedCells = collectionView.indexPathsForSelectedItems, selectedCells.contains(indexPath) { - cell.selectCell(didSelect: true) - } else { - cell.selectCell(didSelect: false) + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: CourseListCVC.className, for: indexPath) as? CourseListCVC else { + return UICollectionViewCell() } let model = courseList[indexPath.item] - let cellTitle = "\(model.departure.region) \(model.departure.city)" + let cellTitle = model.departure.name ?? " " + + cell.setCellType(type: .title) + cell.selectCell(didSelect: collectionView.indexPathsForSelectedItems?.contains(indexPath) ?? false) cell.setData(imageURL: model.image, title: cellTitle, location: nil, didLike: nil, isEditMode: isEditMode) + return cell } From 85918814e828dcb5c54191ea91e767f78ef8782a Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Tue, 12 Dec 2023 23:53:09 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[Chore]=20#199=20-=20makePath=20=EC=84=A0?= =?UTF-8?q?=EC=96=B8=20=EB=B2=94=EC=9C=84=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Running/VC/RunningWaitingVC.swift | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift index ab976a2b..12f1f350 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift @@ -25,7 +25,7 @@ final class RunningWaitingVC: UIViewController { private let recordProvider = Providers.recordProvider // MARK: - UI Components - + private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle(courseTitle ?? "Test Code") private let moreButton = UIButton(type: .system).then { @@ -96,7 +96,7 @@ extension RunningWaitingVC { self.distanceLabel.text = String(distance) } - func makePath(locations: [NMGLatLng]) { + private func makePath(locations: [NMGLatLng]) { self.mapView.makeMarkersWithStartMarker(at: locations, moveCameraToStartMarker: true) } @@ -143,9 +143,9 @@ extension RunningWaitingVC { $0.dataSource = items $0.textFont = .b3 } - + menu.customCellConfiguration = { (index: Index, _: String, cell: DropDownCell) -> Void in - let lastDividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: 79), size: CGSize(width: 170, height: 10))) + let lastDividerLineRemove = UIView(frame: CGRect(origin: CGPoint(x: 0, y: (items.count * 40) - 1), size: CGSize(width: 170, height: 10))) lastDividerLineRemove.backgroundColor = .white cell.separatorInset = .zero cell.dropDownImage.image = imageArray[index] @@ -202,7 +202,7 @@ extension RunningWaitingVC { distanceStackView.snp.makeConstraints { make in make.center.equalToSuperview() } - + startButton.snp.makeConstraints { make in make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) make.height.equalTo(44) @@ -254,8 +254,8 @@ extension RunningWaitingVC { } } } - // MARK: - Network - +// MARK: - Network + extension RunningWaitingVC { private func deleteCourse() { guard let courseId = self.courseId else { return } @@ -316,5 +316,3 @@ extension RunningWaitingVC { } } } - - From f1933490128bf18129271cad01c71f24597d5b66 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 13 Dec 2023 16:21:05 +0900 Subject: [PATCH 10/11] =?UTF-8?q?[Fix]=20#199=20-=20=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presentation/Running/VC/RunningWaitingVC.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift index 12f1f350..f7ffe9fc 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift @@ -187,7 +187,9 @@ extension RunningWaitingVC { view.bringSubviewToFront(moreButton) mapView.snp.makeConstraints { make in - make.edges.equalTo(view.safeAreaLayoutGuide) + make.leading.trailing.equalTo(self.view.safeAreaLayoutGuide) + make.top.equalTo(naviBar.snp.bottom) + make.bottom.equalToSuperview() } distanceContainerView.snp.makeConstraints { make in @@ -206,7 +208,7 @@ extension RunningWaitingVC { startButton.snp.makeConstraints { make in make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) make.height.equalTo(44) - make.top.equalTo(view.snp.bottom).offset(34) + make.top.equalTo(view.snp.bottom).offset(24) } } From ed4a735173304ad64924f385fe719c9f01764000 Mon Sep 17 00:00:00 2001 From: LeeMyeongJin Date: Wed, 13 Dec 2023 18:17:15 +0900 Subject: [PATCH 11/11] =?UTF-8?q?[Feat]=20#199=20-=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=ED=95=98=EA=B8=B0=20=EB=B7=B0=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit post 통신 API가 없어서 일단 코드만 작성 해놨습니다. --- .../Running/VC/RunningWaitingVC.swift | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift index f7ffe9fc..50a0e3a0 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/Running/VC/RunningWaitingVC.swift @@ -300,9 +300,7 @@ extension RunningWaitingVC { switch item { case "수정하기": // 현재 코스 모델의 이름 변경 - let bottomSheetVC = CustomBottomSheetVC(type: .textField) - bottomSheetVC.modalPresentationStyle = .overFullScreen - self.present(bottomSheetVC, animated: false) + ModifyCourseTitle() case "삭제하기": let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") deleteAlertVC.modalPresentationStyle = .overFullScreen @@ -317,4 +315,17 @@ extension RunningWaitingVC { } } } + + private func ModifyCourseTitle() { + let bottomSheetVC = CustomBottomSheetVC(type: .textField) + bottomSheetVC.modalPresentationStyle = .overFullScreen + bottomSheetVC.completeButtonTapAction = { [weak self] text in + guard let self = self else { return } + guard handleVisitor() else { return } + self.courseTitle = text + /// 여기에 id 랑 text post 작업 필요 할 듯? + self.dismiss(animated: false) + } + self.present(bottomSheetVC, animated: false) + } }