From 9fc9a8132897b589b1bf77e0918bdd9d763caf2b Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Wed, 17 May 2023 23:40:56 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[Fix]=20#144=20-=20=EB=A7=88=EC=9D=B4?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=5F=EB=8B=89=EB=84=A4=EC=9E=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=ED=8C=9D=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 수정창을 눌렀을 때 현재 닉네임을 입력창에 띄워주는 것으로 변경 --- .../Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift | 3 +++ .../Presentation/MyPage/VC/NicknameEditorVC.swift | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift index 34d75cf4..8cbf80d0 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift @@ -20,6 +20,7 @@ final class MyPageVC: UIViewController { let stampNameImageDictionary: [String: UIImage] = GoalRewardInfoModel.stampNameImageDictionary var sendEmail = String() + var sendNickname = String() // MARK: - UI Components @@ -178,6 +179,7 @@ extension MyPageVC { private func pushToNicknameEditorVC() { let nicknameEditorVC = NicknameEditorVC() + nicknameEditorVC.setData(nickname: sendNickname) nicknameEditorVC.delegate = self self.navigationController?.pushViewController(nicknameEditorVC, animated: true) } @@ -190,6 +192,7 @@ extension MyPageVC { private func setData(model: MyPageDto) { self.sendEmail = model.user.email + self.sendNickname = model.user.nickname self.myProfileNameLabel.text = model.user.nickname self.myRunningProgressBar.setProgress(Float(model.user.levelPercent)/100, animated: false) setMyRunningProgressPercentLabel(label: myRunnigProgressPercentLabel, model: model) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/NicknameEditorVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/NicknameEditorVC.swift index 840f6bb0..b166da60 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/NicknameEditorVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/NicknameEditorVC.swift @@ -25,13 +25,15 @@ final class NicknameEditorVC: UIViewController { private let nicknameMaxLength: Int = 7 + var currentNickname = String() + // MARK: - UI Components private lazy var navibar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle("닉네임 수정") - private let nickNameTextField = UITextField().then { + private lazy var nickNameTextField = UITextField().then { $0.resignFirstResponder() - $0.text = nil + $0.text = self.currentNickname $0.textColor = .g1 $0.font = .h5 $0.textAlignment = .center @@ -77,6 +79,10 @@ final class NicknameEditorVC: UIViewController { // MARK: - Method extension NicknameEditorVC { + func setData(nickname: String) { + self.currentNickname = nickname + } + private func setAddTarget() { nickNameTextField.addTarget(self, action: #selector(textFieldTextDidChange), for: .editingChanged) } From 4e5395cd982acc88cbc0c32f6e2b0b1caaedb7f1 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Wed, 17 May 2023 23:42:02 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[Fix]=20#144=20-=20=EB=AA=A9=ED=91=9C=20?= =?UTF-8?q?=EB=B3=B4=EC=83=81=5F=EB=92=A4=EB=A1=9C=EA=B0=80=EA=B8=B0=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 해당 뷰에서 바텀네비게이션 제거 --- .../Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift index ecd9e045..eae45f10 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift @@ -62,6 +62,7 @@ final class GoalRewardInfoVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() + self.hideTabBar(wantsToHide: true) setNavigationBar() setUI() setLayout() From ffe04dd61e79d5047db5531e23935bb74f019129 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Thu, 18 May 2023 00:51:24 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[Fix]=20#144=20-=20=EB=AA=A9=ED=91=9C=20?= =?UTF-8?q?=EB=B3=B4=EC=83=81=5F=EC=8A=A4=ED=81=AC=EB=A1=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 일러스트까지 스크롤 영역에 포함되도록 수정 (콜렉션뷰 섹션 분리) --- .../Runnect-iOS.xcodeproj/project.pbxproj | 4 + .../GoalRewardInfoCVC.swift | 5 +- .../GoalRewardTitleCVC.swift | 67 ++++++++++++++++ .../MyPage/VC/InfoVC/GoalRewardInfoVC.swift | 77 ++++++++----------- 4 files changed, 107 insertions(+), 46 deletions(-) create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardTitleCVC.swift diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index b5111d68..221ebe7a 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -28,6 +28,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 */; }; @@ -183,6 +184,7 @@ A3DB8C462A0B64830081AF2D /* ActivityRecordDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityRecordDetailVC.swift; sourceTree = ""; }; A3E55B9F29C815B10000D85D /* SignInSocialLoginVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInSocialLoginVC.swift; sourceTree = ""; }; A3E55BA529C8AB0A0000D85D /* Runnect-iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Runnect-iOS.entitlements"; sourceTree = ""; }; + A3E624FF2A15262B008370FF /* GoalRewardTitleCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalRewardTitleCVC.swift; sourceTree = ""; }; A3F67AE1296D33AC001598A2 /* MyPageDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageDto.swift; sourceTree = ""; }; A3F67AE9296E4936001598A2 /* ActivityRecordInfoDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityRecordInfoDto.swift; sourceTree = ""; }; CE09037C296E9ED900BEA710 /* ScrapCourseResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScrapCourseResponseDto.swift; sourceTree = ""; }; @@ -374,6 +376,7 @@ isa = PBXGroup; children = ( A3BC2F33296303A600198261 /* GoalRewardInfoCVC.swift */, + A3E624FF2A15262B008370FF /* GoalRewardTitleCVC.swift */, ); path = GoalRewardInfoCollectionView; sourceTree = ""; @@ -1404,6 +1407,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 */, diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoCVC.swift index 0ffec711..0e6180d8 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoCVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardInfoCVC.swift @@ -49,10 +49,9 @@ extension GoalRewardInfoCVC { } } +// MARK: - Layout Helpers + extension GoalRewardInfoCVC { - - // MARK: - Layout Helpers - private func setLayout() { contentView.addSubviews(stampImageView, stampStandardLabel) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardTitleCVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardTitleCVC.swift new file mode 100644 index 00000000..686d50fe --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoCollectionView/GoalRewardTitleCVC.swift @@ -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) + } + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift index eae45f10..91136998 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/GoalRewardInfoVC.swift @@ -27,7 +27,7 @@ final class GoalRewardInfoVC: UIViewController { // MARK: - Constants - final let stampInset: UIEdgeInsets = UIEdgeInsets(top: 32, left: 34, bottom: 32, right: 34) + final let stampInset: UIEdgeInsets = UIEdgeInsets(top: 32, left: 34, bottom: 20, right: 34) final let stampLineSpacing: CGFloat = 20 final let stampItemSpacing: CGFloat = 26 final let stampCellHeight: CGFloat = 112 @@ -35,18 +35,7 @@ final class GoalRewardInfoVC: UIViewController { // MARK: - UI Components private lazy var navibar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle("목표 보상") - 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 - } - + private lazy var stampCollectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .vertical @@ -83,6 +72,9 @@ extension GoalRewardInfoVC { private func register() { stampCollectionView.register(GoalRewardInfoCVC.self, forCellWithReuseIdentifier: GoalRewardInfoCVC.className) + stampCollectionView.register(GoalRewardTitleCVC.self, + forCellWithReuseIdentifier: + GoalRewardTitleCVC.className) } func setIsStampExistList(list: [GoalRewardStamp]) { @@ -95,10 +87,10 @@ extension GoalRewardInfoVC { } } +// MARK: - Layout Helpers + extension GoalRewardInfoVC { - // MARK: - Layout Helpers - private func setNavigationBar() { view.addSubview(navibar) @@ -114,30 +106,10 @@ extension GoalRewardInfoVC { } private func setLayout() { - view.addSubviews(stampTopView, stampCollectionView) - - stampTopView.snp.makeConstraints { make in - make.top.equalTo(navibar.snp.bottom) - make.leading.trailing.equalTo(view.safeAreaLayoutGuide) - } - - stampTopView.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) - } + view.addSubview(stampCollectionView) stampCollectionView.snp.makeConstraints { make in - make.top.equalTo(stampTopView.snp.bottom) + make.top.equalTo(navibar.snp.bottom) make.leading.trailing.equalTo(view.safeAreaLayoutGuide) make.bottom.equalToSuperview() } @@ -147,18 +119,30 @@ extension GoalRewardInfoVC { // MARK: - UICollectionViewDelegateFlowLayout extension GoalRewardInfoVC: UICollectionViewDelegateFlowLayout { + func numberOfSections(in collectionView: UICollectionView) -> Int { + return 2 + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + let screenWidth = UIScreen.main.bounds.width - let tripleCellWidth = screenWidth - stampInset.left - stampInset.right - stampItemSpacing * 2 - let cellHeight = tripleCellWidth / 3 + 22 - return CGSize(width: tripleCellWidth / 3, height: cellHeight) + + if indexPath.section == 0 { + return CGSize(width: screenWidth, height: 227) + } else { + let tripleCellWidth = screenWidth - stampInset.left - stampInset.right - stampItemSpacing * 2 + let cellHeight = tripleCellWidth / 3 + 22 + return CGSize(width: tripleCellWidth / 3, height: cellHeight) + } } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + if section == 0 { return 0 } return stampLineSpacing } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + if section == 0 { return .zero } return stampInset } } @@ -167,13 +151,20 @@ extension GoalRewardInfoVC: UICollectionViewDelegateFlowLayout { extension GoalRewardInfoVC: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + if section == 0 { return 1 } return stampNameList.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - guard let stampCell = collectionView.dequeueReusableCell(withReuseIdentifier: GoalRewardInfoCVC.className, for: indexPath) as? GoalRewardInfoCVC else { return UICollectionViewCell()} - stampCell.setData(model: stampNameList[indexPath.item], item: isStampExistList[indexPath.item]) - return stampCell + + if indexPath.section == 0 { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: GoalRewardTitleCVC.className, for: indexPath) as? GoalRewardTitleCVC else { return UICollectionViewCell()} + return cell + } else { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: GoalRewardInfoCVC.className, for: indexPath) as? GoalRewardInfoCVC else { return UICollectionViewCell()} + cell.setData(model: stampNameList[indexPath.item], item: isStampExistList[indexPath.item]) + return cell + } } } From fa074d59e7234f9efa52ed13e64553e4a0087e39 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Thu, 18 May 2023 01:13:30 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[Fix]=20#144=20-=20=EC=84=A4=EC=A0=95=5F?= =?UTF-8?q?=EC=9D=B4=EC=9A=A9=EC=95=BD=EA=B4=80=20=EB=B2=84=ED=8A=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 이용약관 노션 연결 --- Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj | 4 ---- .../Presentation/MyPage/VC/SettingVC/SettingVC.swift | 10 ++++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index 221ebe7a..7f49dd13 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -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 */; }; @@ -174,7 +173,6 @@ A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NicknameEditorVC.swift; sourceTree = ""; }; A3BC2F422966A93100198261 /* CourseDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetailVC.swift; sourceTree = ""; }; A3C2CACD29E313CC00EC525B /* SettingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingVC.swift; sourceTree = ""; }; - A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsOfServiceVC.swift; sourceTree = ""; }; A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonalInfoVC.swift; sourceTree = ""; }; A3C2CAD629E53B2900EC525B /* RNAlertVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNAlertVC.swift; sourceTree = ""; }; A3C38FEC2A13212300FF196D /* SetInfoLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetInfoLayout.swift; sourceTree = ""; }; @@ -401,7 +399,6 @@ isa = PBXGroup; children = ( A3C2CACD29E313CC00EC525B /* SettingVC.swift */, - A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */, A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */, ); path = SettingVC; @@ -1372,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 */, diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift index 5aa478e6..f2771c06 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift @@ -26,6 +26,9 @@ final class SettingVC: UIViewController { let reportUrl = NSURL(string: "https://docs.google.com/forms/d/e/1FAIpQLSek2rkClKfGaz1zwTEHX3Oojbq_pbF3ifPYMYezBU0_pe-_Tg/viewform") lazy var reportSafariView: SFSafariViewController = SFSafariViewController(url: self.reportUrl! as URL) + let termsOfServiceUrl = NSURL(string: "https://www.notion.so/Runnect-81cf5a3a507b40e4b6104b5d08f12792?pvs=4") + lazy var termsOfServiceSafariView: SFSafariViewController = SFSafariViewController(url: self.termsOfServiceUrl! as URL) + private lazy var personalInfoView = makeInfoView(title: "계정 정보").then { let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpPersonalInfoView)) $0.addGestureRecognizer(tap) @@ -90,11 +93,6 @@ extension SettingVC { personalInfoVC.email = self.email self.navigationController?.pushViewController(personalInfoVC, animated: true) } - - private func pushToTermsOfServiceVC() { - let termsOfServiceVC = TermsOfServiceVC() - self.navigationController?.pushViewController(termsOfServiceVC, animated: true) - } } // MARK: - @objc Function @@ -112,7 +110,7 @@ extension SettingVC { @objc private func touchUpTermsOfServiceView() { - pushToTermsOfServiceVC() + self.present(self.termsOfServiceSafariView, animated: true, completion: nil) } } From 9187bcc6a2f66bcb54ee937e1286492fdc2271e9 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Thu, 18 May 2023 01:24:33 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[Fix]=20#144=20-=20=EB=9F=AC=EB=8B=9D?= =?UTF-8?q?=ED=8A=B8=EB=9E=98=ED=82=B9=5F=EB=9F=AC=EB=8B=9D=20=EC=A2=85?= =?UTF-8?q?=EB=A3=8C=20=EB=B2=84=ED=8A=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 맞춤법 --- .../Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift index 611dda82..ed67043c 100644 --- a/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift +++ b/Runnect-iOS/Runnect-iOS/Global/UIComponents/CustomBottomSheetVC.swift @@ -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 From 78523bd291031ba4543390b7bc9e5c6f67a49cf8 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Sat, 20 May 2023 01:07:02 +0900 Subject: [PATCH 6/8] =?UTF-8?q?[Fix]=20#144=20-=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityRecordInfoTVC.swift | 8 ++++ .../VC/InfoVC/ActivityRecordInfoVC.swift | 42 +++++++------------ 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift index a80ac33c..23c56901 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift @@ -121,6 +121,14 @@ extension ActivityRecordInfoTVC { activityRecordMapImage.setImage(with: model.image) } + func updateSelectionCellUI(isSelected: Bool) { + if isSelected { + activityRecordContainerView.image = ImageLiterals.imgRecordContainerSelected + } else { + activityRecordContainerView.image = 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])) 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 9dec64aa..75206f62 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift @@ -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() } } @@ -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() } } @@ -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) @@ -260,7 +262,7 @@ extension ActivityRecordInfoVC: UITableViewDelegate { } func tableView(_ tableView: UITableView, didDeselectRowAt 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 { self.deleteRecordButton.isEnabled = false self.deleteRecordButton.setTitle(title: "삭제하기") @@ -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 } } From 4be9e88772666f3a294b36fa2703323a088ae163 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Sat, 20 May 2023 01:14:07 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[Fix]=20#144=20-=20=EB=A6=B0=ED=8A=B8=20?= =?UTF-8?q?=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CourseDiscovery/Views/VC/CourseDiscoveryVC.swift | 1 - .../Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift index 96c526fb..087eaf69 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/VC/CourseDiscoveryVC.swift @@ -21,7 +21,6 @@ final class CourseDiscoveryVC: UIViewController { private var courseList = [PublicCourse]() - // MARK: - UIComponents private lazy var naviBar = CustomNavigationBar(self, type: .title).setTitle("코스 발견") 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 75206f62..5abaa988 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoVC.swift @@ -262,7 +262,7 @@ extension ActivityRecordInfoVC: UITableViewDelegate { } func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) { - guard let cell = tableView.cellForRow(at: indexPath) as? ActivityRecordInfoTVC else { return } + guard tableView.cellForRow(at: indexPath) is ActivityRecordInfoTVC else { return } guard let selectedRecords = tableView.indexPathsForSelectedRows else { self.deleteRecordButton.isEnabled = false self.deleteRecordButton.setTitle(title: "삭제하기") From 5d655061cd517b77fc3a2f899de3a5f820ee1139 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Sun, 21 May 2023 23:29:13 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[Fix]=20#144=20-=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift index 23c56901..a642dd24 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/InfoVC/ActivityRecordInfoTableView/ActivityRecordInfoTVC.swift @@ -122,11 +122,7 @@ extension ActivityRecordInfoTVC { } func updateSelectionCellUI(isSelected: Bool) { - if isSelected { - activityRecordContainerView.image = ImageLiterals.imgRecordContainerSelected - } else { - activityRecordContainerView.image = ImageLiterals.imgRecordContainer - } + activityRecordContainerView.image = isSelected ? ImageLiterals.imgRecordContainerSelected : ImageLiterals.imgRecordContainer } private func setUpActivityRecordPlaceLabel(model: ActivityRecord, label: UILabel) {