From 68795d08dbec3de079062cb8ad4685a0b349f687 Mon Sep 17 00:00:00 2001 From: yeonwoo Date: Fri, 19 May 2023 19:04:33 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20#134-=20conflict=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/UIComponents/RNAlertVC.swift | 23 +---------------- .../CourseStorage/VC/CourseStorageVC.swift | 12 +++------ .../VC/InfoVC/ActivityRecordDetailVC.swift | 25 ++----------------- .../VC/InfoVC/ActivityRecordInfoVC.swift | 12 ++------- .../VC/InfoVC/UploadedCourseInfoVC.swift | 20 +++++++-------- 5 files changed, 18 insertions(+), 74 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift index cf68bc66..be9bb054 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift @@ -15,14 +15,7 @@ final class RNAlertVC: UIViewController { // MARK: - Properties var rightButtonTapAction: (() -> Void)? - -<<<<<<< HEAD -// weak var delegate: RNAlertVCDeleagte? -// -======= - var deleteRecordDelegate: deleteRecordDelegate? - ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 + // MARK: - UI Components private let containerView = UIView().then { @@ -86,15 +79,6 @@ extension RNAlertVC { self.yesButton.addTarget(self, action: #selector(touchYesButton), for: .touchUpInside) } -<<<<<<< HEAD -======= - @discardableResult - func setButtonTitle(_ leftButtonTitle: String, _ rightButtonTitle: String) -> Self { - self.yesButton.setTitle(rightButtonTitle, for: .normal) - self.noButton.setTitle(leftButtonTitle, for: .normal) - return self - } ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 } // MARK: - @objc Function @@ -106,11 +90,6 @@ extension RNAlertVC { @objc private func touchYesButton() { self.rightButtonTapAction?() -<<<<<<< HEAD - -======= - deleteRecordDelegate?.wantsToDelete() ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift index 56f9ecbd..cb8fd11e 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseStorage/VC/CourseStorageVC.swift @@ -166,28 +166,22 @@ extension CourseStorageVC { view.backgroundColor = .w1 } private func setLayout() { -<<<<<<< HEAD - view.addSubviews(naviBar, viewPager, deleteCourseButton) - view.bringSubviewToFront(viewPager) -======= view.addSubviews(naviBar) ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 + naviBar.snp.makeConstraints { make in make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) make.height.equalTo(48) } -<<<<<<< HEAD -======= + guard UserManager.shared.userType != .visitor else { self.showSignInRequestEmptyView() return } - view.addSubview(viewPager) + view.addSubviews(viewPager, deleteCourseButton) ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 viewPager.snp.makeConstraints { make in make.top.equalTo(naviBar.snp.bottom) make.leading.bottom.trailing.equalTo(view.safeAreaLayoutGuide) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordDetailVC.swift index 509228d0..dd191096 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordDetailVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordDetailVC.swift @@ -70,28 +70,16 @@ final class ActivityRecordDetailVC: UIViewController { private lazy var recordDistanceLabel = SetInfoLayout.makeGreySmailTitleLabel().then { $0.text = "거리" } -<<<<<<< HEAD - - private lazy var recordRunningTimeLabel = setGreyTitle().then { -======= private lazy var recordRunningTimeLabel = SetInfoLayout.makeGreySmailTitleLabel().then { ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 $0.text = "이동 시간" } private lazy var recordAveragePaceLabel = SetInfoLayout.makeGreySmailTitleLabel().then { $0.text = "평균 페이스" } -<<<<<<< HEAD - - private lazy var recordDistanceValueLabel = setBlackTitle().then { - $0.text = "5.1km" - } -======= private lazy var recordDistanceValueLabel = SetInfoLayout.makeBlackTitleLabel() ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 private lazy var recordRunningTimeValueLabel = SetInfoLayout.makeBlackTitleLabel() @@ -142,7 +130,7 @@ extension ActivityRecordDetailVC { // 수정 모드일 때 self.setEditMode() }) - let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") + let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?") deleteAlertVC.modalPresentationStyle = .overFullScreen let deleteAlertAction = UIAlertAction(title: "삭제하기", style: .destructive, handler: {(_: UIAlertAction!) in self.present(deleteAlertVC, animated: false, completion: nil)}) @@ -166,7 +154,6 @@ extension ActivityRecordDetailVC { } else { // 수정이 된 상태라면 팝업을 띄워주기 self.navibar.resetLeftButtonAction({ [weak self] in - //self?.navibar.leftButton.addTarget(self, action: #selector(self?.presentToQuitEditAlertVC), for: .touchUpInside) self?.presentToQuitEditAlertVC() }, .titleWithLeftButton) } @@ -199,7 +186,7 @@ extension ActivityRecordDetailVC { } @objc private func finishEditButtonDidTap() { - editRecordTitle() +// editRecordTitle() showToast(message: "제목 수정이 완료되었어요") // 수정이 완료되면 팝업 뜨지 않음 @@ -499,13 +486,6 @@ extension ActivityRecordDetailVC { print("result:", result) let status = result.statusCode if 200..<300 ~= status { -<<<<<<< HEAD - do { - let responseDto = try result.map(BaseResponse.self) - } catch { - print(error.localizedDescription) - } -======= print("삭제 성공") self.navigationController?.popViewController(animated: false) let activityRecordInfoVC = ActivityRecordInfoVC() @@ -536,7 +516,6 @@ extension ActivityRecordDetailVC { let status = result.statusCode if 200..<300 ~= status { print("제목 수정 성공") ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 } if status >= 400 { print("400 error") diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift index c8aa2081..dada6819 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift @@ -162,12 +162,11 @@ extension ActivityRecordInfoVC { } @objc func deleteRecordButtonDidTap() { - let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?").setButtonTitle("취소", "삭제하기") - deleteAlertVC.modalPresentationStyle = .overFullScreen - deleteAlertVC.deleteRecordDelegate = self + let deleteAlertVC = RNAlertVC(description: "러닝 기록을 정말로 삭제하시겠어요?") self.present(deleteAlertVC, animated: false, completion: nil) deleteAlertVC.rightButtonTapAction = { [weak self] in deleteAlertVC.dismiss(animated: false) + } } } @@ -243,11 +242,7 @@ extension ActivityRecordInfoVC: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { guard tableView.cellForRow(at: indexPath) is ActivityRecordInfoTVC else { return } guard let selectedRecords = tableView.indexPathsForSelectedRows else { return } -<<<<<<< HEAD - let activityRecordList = activityRecordList [indexPath.item] -======= ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 if isEditMode { self.deleteRecordButton.isEnabled = true let countSelectedRows = selectedRecords.count @@ -256,13 +251,10 @@ extension ActivityRecordInfoVC: UITableViewDelegate { let activityRecordDetailVC = ActivityRecordDetailVC() tableView.deselectRow(at: indexPath, animated: true) self.deleteRecordButton.setTitle(title: "삭제하기") -<<<<<<< HEAD -======= activityRecordDetailVC.setData(model: activityRecordList[indexPath.row]) // 편집 모드가 아닐 때 상세 페이지로 이동 self.navigationController?.pushViewController(activityRecordDetailVC, animated: true) ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift index e7cc285b..144624b0 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/UploadedCourseInfoVC.swift @@ -252,17 +252,17 @@ extension UploadedCourseInfoVC: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { return uploadedCourseInset } -<<<<<<< HEAD -======= +//<<<<<<< HEAD +//======= - func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - let courseDetailVC = CourseDetailVC() - let courseModel = uploadedCourseList[indexPath.item] - courseDetailVC.setCourseId(courseId: courseModel.courseId, publicCourseId: courseModel.id) - courseDetailVC.hidesBottomBarWhenPushed = true - self.navigationController?.pushViewController(courseDetailVC, animated: true) - } ->>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 +// func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { +// let courseDetailVC = CourseDetailVC() +// let courseModel = uploadedCourseList[indexPath.item] +// courseDetailVC.setCourseId(courseId: courseModel.courseId, publicCourseId: courseModel.id) +// courseDetailVC.hidesBottomBarWhenPushed = true +// self.navigationController?.pushViewController(courseDetailVC, animated: true) +// } +//>>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5 } // MARK: - UICollectionViewDataSource