Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
A3BC2F4129667A0D00198261 /* NicknameEditorVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */; };
A3BC2F432966A93100198261 /* CourseDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F422966A93100198261 /* CourseDetailVC.swift */; };
A3C2CACE29E313CC00EC525B /* SettingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CACD29E313CC00EC525B /* SettingVC.swift */; };
A3C2CAD329E4F77C00EC525B /* TermsOfServiceVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */; };
A3C2CAD529E4F85400EC525B /* PersonalInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */; };
A3C2CAD729E53B2900EC525B /* RNAlertVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */; };
A3C38FED2A13212300FF196D /* SetInfoLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C38FEC2A13212300FF196D /* SetInfoLayout.swift */; };
Expand All @@ -28,6 +27,7 @@
A3D1A78029CF142E00DD54EC /* UserManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77F29CF142E00DD54EC /* UserManager.swift */; };
A3DB8C472A0B64830081AF2D /* ActivityRecordDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3DB8C462A0B64830081AF2D /* ActivityRecordDetailVC.swift */; };
A3E55BA029C815B10000D85D /* SignInSocialLoginVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3E55B9F29C815B10000D85D /* SignInSocialLoginVC.swift */; };
A3E625002A15262B008370FF /* GoalRewardTitleCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3E624FF2A15262B008370FF /* GoalRewardTitleCVC.swift */; };
A3F67AE2296D33AC001598A2 /* MyPageDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3F67AE1296D33AC001598A2 /* MyPageDto.swift */; };
A3F67AEA296E4936001598A2 /* ActivityRecordInfoDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3F67AE9296E4936001598A2 /* ActivityRecordInfoDto.swift */; };
CE09037D296E9ED900BEA710 /* ScrapCourseResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE09037C296E9ED900BEA710 /* ScrapCourseResponseDto.swift */; };
Expand Down Expand Up @@ -173,7 +173,6 @@
A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NicknameEditorVC.swift; sourceTree = "<group>"; };
A3BC2F422966A93100198261 /* CourseDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetailVC.swift; sourceTree = "<group>"; };
A3C2CACD29E313CC00EC525B /* SettingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingVC.swift; sourceTree = "<group>"; };
A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsOfServiceVC.swift; sourceTree = "<group>"; };
A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonalInfoVC.swift; sourceTree = "<group>"; };
A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNAlertVC.swift; sourceTree = "<group>"; };
A3C38FEC2A13212300FF196D /* SetInfoLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetInfoLayout.swift; sourceTree = "<group>"; };
Expand All @@ -183,6 +182,7 @@
A3DB8C462A0B64830081AF2D /* ActivityRecordDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityRecordDetailVC.swift; sourceTree = "<group>"; };
A3E55B9F29C815B10000D85D /* SignInSocialLoginVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInSocialLoginVC.swift; sourceTree = "<group>"; };
A3E55BA529C8AB0A0000D85D /* Runnect-iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Runnect-iOS.entitlements"; sourceTree = "<group>"; };
A3E624FF2A15262B008370FF /* GoalRewardTitleCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalRewardTitleCVC.swift; sourceTree = "<group>"; };
A3F67AE1296D33AC001598A2 /* MyPageDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageDto.swift; sourceTree = "<group>"; };
A3F67AE9296E4936001598A2 /* ActivityRecordInfoDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityRecordInfoDto.swift; sourceTree = "<group>"; };
CE09037C296E9ED900BEA710 /* ScrapCourseResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrapCourseResponseDto.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -374,6 +374,7 @@
isa = PBXGroup;
children = (
A3BC2F33296303A600198261 /* GoalRewardInfoCVC.swift */,
A3E624FF2A15262B008370FF /* GoalRewardTitleCVC.swift */,
);
path = GoalRewardInfoCollectionView;
sourceTree = "<group>";
Expand All @@ -398,7 +399,6 @@
isa = PBXGroup;
children = (
A3C2CACD29E313CC00EC525B /* SettingVC.swift */,
A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */,
A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */,
);
path = SettingVC;
Expand Down Expand Up @@ -1369,7 +1369,6 @@
A3DB8C472A0B64830081AF2D /* ActivityRecordDetailVC.swift in Sources */,
CE14677C2965C1B100DCEA1B /* RunningRecordVC.swift in Sources */,
CE6B63D829673450003F900F /* ListEmptyView.swift in Sources */,
A3C2CAD329E4F77C00EC525B /* TermsOfServiceVC.swift in Sources */,
CE6655F6295D90B600C64E12 /* addToolBar.swift in Sources */,
A3C2CAD529E4F85400EC525B /* PersonalInfoVC.swift in Sources */,
DAD5A3DA296C6DA500C8166B /* TitleCollectionViewCell.swift in Sources */,
Expand Down Expand Up @@ -1404,6 +1403,7 @@
CE0D9FD329648DA300CEB5CD /* CustomAlertVC.swift in Sources */,
CEB841702963360800BF8080 /* CountDownVC.swift in Sources */,
CE320F38296C8FAB009F89A7 /* CourseDrawingResponseData.swift in Sources */,
A3E625002A15262B008370FF /* GoalRewardTitleCVC.swift in Sources */,
A3D1A77E29CF09B600DD54EC /* SignInResponseDto.swift in Sources */,
CE21C028299E5FFC00F62AF5 /* PublicCourseRouter.swift in Sources */,
CE18E894296C79B900FEB569 /* CourseDrawingRequestDto.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class CustomBottomSheetVC: UIViewController {
$0.image = ImageLiterals.imgSpaceship
}

private let completeButton = CustomButton(title: "기록 보러가기")
private let completeButton = CustomButton(title: "기록 보러 가기")

// MARK: - View Life Cycle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ final class CourseDiscoveryVC: UIViewController {

private var courseList = [PublicCourse]()


// MARK: - UIComponents

private lazy var naviBar = CustomNavigationBar(self, type: .title).setTitle("코스 발견")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ extension ActivityRecordInfoTVC {
activityRecordMapImage.setImage(with: model.image)
}

func updateSelectionCellUI(isSelected: Bool) {
activityRecordContainerView.image = isSelected ? ImageLiterals.imgRecordContainerSelected : ImageLiterals.imgRecordContainer
}

private func setUpActivityRecordPlaceLabel(model: ActivityRecord, label: UILabel) {
let attributedString = NSMutableAttributedString(string: String(model.departure.region) + " ", attributes: [.font: UIFont.b8, .foregroundColor: UIColor.g2])
attributedString.append(NSAttributedString(string: String(model.departure.city), attributes: [.font: UIFont.b8, .foregroundColor: UIColor.g2]))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,18 @@ extension ActivityRecordInfoVC {
self.editButton.setTitle("편집", for: .normal)
self.deleteRecordButton.isHidden = true
self.totalNumOfRecordlabel.text = "총 기록 \(self.activityRecordList.count)개"
deselectedActivityRecordTableRows()
self.deleteRecordButton.isEnabled = false
self.deleteRecordButton.setTitle(title: "삭제하기")
self.activityRecordTableView.reloadData()
}

private func deselectedActivityRecordTableRows() {
if let selectedRows = activityRecordTableView.indexPathsForSelectedRows {
for indexPath in selectedRows {
activityRecordTableView.deselectRow(at: indexPath, animated: true)
}
}
self.deleteRecordButton.isEnabled = false
self.deleteRecordButton.setTitle(title: "삭제하기")
self.activityRecordTableView.reloadData()
}
}

Expand Down Expand Up @@ -143,21 +147,17 @@ extension ActivityRecordInfoVC {
self.totalNumOfRecordlabel.text = "총 기록 \(self.activityRecordList.count)개"
self.editButton.setTitle("편집", for: .normal)
self.deleteRecordButton.isHidden = true
if let selectedRows = activityRecordTableView.indexPathsForSelectedRows {
for indexPath in selectedRows {
activityRecordTableView.deselectRow(at: indexPath, animated: true)
}
}
deselectedActivityRecordTableRows()
self.deleteRecordButton.isEnabled = false
self.deleteRecordButton.setTitle(title: "삭제하기")
self.activityRecordTableView.reloadData()
isEditMode = false
isEditMode.toggle()
} else {
self.totalNumOfRecordlabel.text = "기록 선택"
self.editButton.setTitle("취소", for: .normal)
self.deleteRecordButton.isHidden = false
self.activityRecordTableView.reloadData()
isEditMode = true
isEditMode.toggle()
}
}

Expand Down Expand Up @@ -241,18 +241,20 @@ extension ActivityRecordInfoVC: UITableViewDelegate {
}

func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
guard tableView.cellForRow(at: indexPath) is ActivityRecordInfoTVC else { return }
guard let cell = tableView.cellForRow(at: indexPath) as? ActivityRecordInfoTVC else { return }
guard let selectedRecords = tableView.indexPathsForSelectedRows else { return }

if isEditMode {
self.deleteRecordButton.isEnabled = true
let countSelectedRows = selectedRecords.count
self.deleteRecordButton.setTitle(title: "삭제하기(\(countSelectedRows))")
cell.updateSelectionCellUI(isSelected: true)
} else {
let activityRecordDetailVC = ActivityRecordDetailVC()
tableView.deselectRow(at: indexPath, animated: true)
self.deleteRecordButton.setTitle(title: "삭제하기")
activityRecordDetailVC.setData(model: activityRecordList[indexPath.row])
cell.updateSelectionCellUI(isSelected: false)

// 편집 모드가 아닐 때 상세 페이지로 이동
self.navigationController?.pushViewController(activityRecordDetailVC, animated: true)
Expand Down Expand Up @@ -287,22 +289,6 @@ extension ActivityRecordInfoVC: UITableViewDataSource {
guard let activityRecordCell = tableView.dequeueReusableCell(withIdentifier: ActivityRecordInfoTVC.className, for: indexPath) as? ActivityRecordInfoTVC else { return UITableViewCell()}
activityRecordCell.selectionStyle = .none
activityRecordCell.setData(model: activityRecordList[indexPath.item])
if isEditMode {
// 선택된 셀에 대한 표시 업데이트
if let selectedRecords = tableView.indexPathsForSelectedRows, selectedRecords.contains(indexPath) {
activityRecordCell.activityRecordContainerView.image = ImageLiterals.imgRecordContainerSelected
} else {
activityRecordCell.activityRecordContainerView.image = ImageLiterals.imgRecordContainer
}

} else {
activityRecordCell.selectionStyle = .none
// 선택된 셀들을 순회하면서 미선택 이미지로 변경
for indexPath in tableView.indexPathsForSelectedRows ?? [] {
guard let cell = tableView.cellForRow(at: indexPath) as? ActivityRecordInfoTVC else { continue }
cell.activityRecordContainerView.image = ImageLiterals.imgRecordContainer
}
}
return activityRecordCell
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ extension GoalRewardInfoCVC {
}
}

// MARK: - Layout Helpers

extension GoalRewardInfoCVC {

// MARK: - Layout Helpers

private func setLayout() {
contentView.addSubviews(stampImageView, stampStandardLabel)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// GoalRewardTitleCVC.swift
// Runnect-iOS
//
// Created by 몽이 누나 on 2023/05/18.
//

import UIKit

import SnapKit
import Then

// MARK: - GoalRewardTitleCVC

final class GoalRewardTitleCVC: UICollectionViewCell {

// MARK: - UI Components

private let stampTopView = UIView()

private let stampImage = UIImageView().then {
$0.image = ImageLiterals.imgStamp
}

private let stampExcourageLabel = UILabel().then {
$0.text = "다양한 코스를 달리며 러닝 스탬프를 모아봐요"
$0.textColor = .g2
$0.font = .b4
}

// MARK: - Life Cycles

override init(frame: CGRect) {
super.init(frame: frame)
setLayout()
setUI()
}

required init(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}

// MARK: - Layout Helpers

extension GoalRewardTitleCVC {
private func setUI() {
contentView.backgroundColor = .w1
}

private func setLayout() {
contentView.addSubviews(stampImage, stampExcourageLabel)

stampImage.snp.makeConstraints { make in
make.top.equalToSuperview().inset(18)
make.centerX.equalToSuperview()
make.width.equalTo(139)
make.height.equalTo(126)
}

stampExcourageLabel.snp.makeConstraints { make in
make.top.equalTo(stampImage.snp.bottom).offset(32)
make.centerX.equalToSuperview()
make.bottom.equalToSuperview().inset(37)
}
}
}
Loading