Skip to content

Commit

Permalink
[Fix] Runnect#134- conflict 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-yeonwoo2 committed May 19, 2023
1 parent a459f0c commit 68795d0
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 74 deletions.
23 changes: 1 addition & 22 deletions Runnect-iOS/Runnect-iOS/Global/UIComponents/RNAlertVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -106,11 +90,6 @@ extension RNAlertVC {

@objc private func touchYesButton() {
self.rightButtonTapAction?()
<<<<<<< HEAD

=======
deleteRecordDelegate?.wantsToDelete()
>>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5
}
}

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

Expand Down Expand Up @@ -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)})
Expand All @@ -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)
}
Expand Down Expand Up @@ -199,7 +186,7 @@ extension ActivityRecordDetailVC {
}

@objc private func finishEditButtonDidTap() {
editRecordTitle()
// editRecordTitle()
showToast(message: "제목 수정이 완료되었어요")

// 수정이 완료되면 팝업 뜨지 않음
Expand Down Expand Up @@ -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<ActivityRecordInfoDto>.self)
} catch {
print(error.localizedDescription)
}
=======
print("삭제 성공")
self.navigationController?.popViewController(animated: false)
let activityRecordInfoVC = ActivityRecordInfoVC()
Expand Down Expand Up @@ -536,7 +516,6 @@ extension ActivityRecordDetailVC {
let status = result.statusCode
if 200..<300 ~= status {
print("제목 수정 성공")
>>>>>>> b3d6309976964fe58bb68432c068d27d31a9f4f5
}
if status >= 400 {
print("400 error")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
}
}
Expand Down Expand Up @@ -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
Expand All @@ -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
}
}

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

0 comments on commit 68795d0

Please sign in to comment.