From 30bc29ca917f4af39c1381bb3f3889912b2cfa94 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Mon, 10 Apr 2023 01:09:56 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[Feat]=20#127=20-=20MyPageVC=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EB=90=9C=20UI=20components=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runnect-iOS.xcodeproj/project.pbxproj | 4 + .../Presentation/MyPage/VC/MyPageVC.swift | 102 ++++++++++++++++-- .../Presentation/MyPage/VC/SettingVC.swift | 35 ++++++ 3 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC.swift diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index 4aeb993e..ef34a5f2 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ A3BC2F3F2964706100198261 /* UploadedCourseInfoCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F3E2964706100198261 /* UploadedCourseInfoCVC.swift */; }; 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 */; }; A3D1A77929CF03D200DD54EC /* AuthRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77829CF03D200DD54EC /* AuthRouter.swift */; }; A3D1A77E29CF09B600DD54EC /* SignInResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */; }; A3D1A78029CF142E00DD54EC /* UserManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77F29CF142E00DD54EC /* UserManager.swift */; }; @@ -163,6 +164,7 @@ A3BC2F3E2964706100198261 /* UploadedCourseInfoCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadedCourseInfoCVC.swift; sourceTree = ""; }; 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 = ""; }; A3D1A77829CF03D200DD54EC /* AuthRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRouter.swift; sourceTree = ""; }; A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInResponseDto.swift; sourceTree = ""; }; A3D1A77F29CF142E00DD54EC /* UserManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserManager.swift; sourceTree = ""; }; @@ -683,6 +685,7 @@ A3BC2F292962C39F00198261 /* InfoVC */, CEEC6B3F2961C55000D00E1E /* MyPageVC.swift */, A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */, + A3C2CACD29E313CC00EC525B /* SettingVC.swift */, ); path = VC; sourceTree = ""; @@ -1398,6 +1401,7 @@ CE17F02D2961BBA100E1DED0 /* ColorLiterals.swift in Sources */, CEC2A68E2962AF2C00160BF7 /* RNMarker.swift in Sources */, CE6655D2295D862A00C64E12 /* Publisher+Driver.swift in Sources */, + A3C2CACE29E313CC00EC525B /* SettingVC.swift in Sources */, CE21C02E299E601700F62AF5 /* StampRouter.swift in Sources */, CE6655E6295D887F00C64E12 /* UIStackView+.swift in Sources */, A3BC2F34296303A600198261 /* GoalRewardInfoCVC.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift index e969717c..070e91f9 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift @@ -24,9 +24,13 @@ final class MyPageVC: UIViewController { private lazy var navibar = CustomNavigationBar(self, type: .title).setTitle("마이페이지") private let myProfileView = UIView() private let myRunningProgressView = UIView() + private let versionInfoView = UIView() private let firstDivideView = UIView() private let secondDivideView = UIView() private let thirdDivideView = UIView() + private let fourthDivideView = UIView() + private let topVersionDivideView = UIView() + private let bottomVersionDivideView = UIView() private let myProfileImage = UIImageView() @@ -79,6 +83,23 @@ final class MyPageVC: UIViewController { $0.addGestureRecognizer(tap) } + private lazy var settingView = makeInfoView(title: "설정").then { + let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpSettingView)) + $0.addGestureRecognizer(tap) + } + + private let versionInfoLabel = UILabel().then { + $0.textColor = .g2 + $0.font = .b2 + $0.text = "버전 정보" + } + + private let versionInfoValueLabel = UILabel().then { + $0.textColor = .g2 + $0.font = .b2 + $0.text = "v. 1.0.1" + } + // MARK: - View Life Cycle override func viewDidLoad() { @@ -130,7 +151,7 @@ extension MyPageVC { icArrowRight.snp.makeConstraints { make in make.top.equalToSuperview().offset(18) - make.trailing.equalToSuperview().inset(8) + make.trailing.equalToSuperview().inset(10) } return containerView @@ -158,6 +179,11 @@ extension MyPageVC { self.present(nicknameEditorVC, animated: false) } + private func pushToSettingVC() { + let settingVC = SettingVC() + self.navigationController?.pushViewController(settingVC, animated: true) + } + private func setData(model: MyPageDto) { self.myProfileNameLabel.text = model.user.nickname self.myRunningProgressBar.setProgress(Float(model.user.levelPercent)/100, animated: false) @@ -206,6 +232,11 @@ extension MyPageVC { private func touchUpNicknameEditorView() { pushToNicknameEditorVC() } + + @objc + private func touchUpSettingView() { + pushToSettingVC() + } } // MARK: - UI & Layout @@ -226,12 +257,15 @@ extension MyPageVC { firstDivideView.backgroundColor = .g5 secondDivideView.backgroundColor = .g4 thirdDivideView.backgroundColor = .g4 + fourthDivideView.backgroundColor = .g4 + topVersionDivideView.backgroundColor = .g5 + bottomVersionDivideView.backgroundColor = .g5 } private func setLayout() { view.addSubviews(myProfileView, myRunningProgressView, firstDivideView, goalRewardInfoView, secondDivideView, activityRecordInfoView, - thirdDivideView, uploadedCourseInfoView) + thirdDivideView, uploadedCourseInfoView, fourthDivideView, settingView) myProfileView.snp.makeConstraints { make in make.top.equalTo(navibar.snp.bottom).offset(6) @@ -249,6 +283,7 @@ extension MyPageVC { } setInfoButtonLayout() + setVersionInfoLayout() } private func setMyProfileLayout() { @@ -274,9 +309,9 @@ extension MyPageVC { } myRunningProgressView.snp.makeConstraints { make in - make.top.equalTo(myProfileView.snp.bottom).offset(18) - make.leading.trailing.equalToSuperview().inset(16) - make.height.equalTo(55) + make.top.equalTo(myProfileView.snp.bottom).offset(31) + make.leading.trailing.equalToSuperview().inset(32) + make.height.equalTo(61) } } @@ -286,7 +321,7 @@ extension MyPageVC { myRunningLevelLavel.snp.makeConstraints { make in make.top.equalToSuperview() - make.leading.equalToSuperview().offset(1) + make.leading.equalToSuperview().offset(3) } myRunningProgressBar.snp.makeConstraints { make in @@ -331,7 +366,60 @@ extension MyPageVC { make.leading.trailing.equalToSuperview() make.height.equalTo(60) } - } + + activityRecordInfoView.snp.makeConstraints { make in + make.top.equalTo(secondDivideView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(60) + } + + fourthDivideView.snp.makeConstraints { make in + make.top.equalTo(uploadedCourseInfoView.snp.bottom).offset(1) + make.leading.trailing.equalToSuperview() + make.height.equalTo(0.5) + } + + settingView.snp.makeConstraints { make in + make.top.equalTo(fourthDivideView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(60) + } + + } + + private func setVersionInfoLayout() { + view.addSubviews(topVersionDivideView, versionInfoView, bottomVersionDivideView) + + topVersionDivideView.snp.makeConstraints { make in + make.top.equalTo(settingView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(4) + } + + versionInfoView.snp.makeConstraints { make in + make.top.equalTo(settingView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(62) + } + + bottomVersionDivideView.snp.makeConstraints { make in + make.top.equalTo(versionInfoView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(4) + } + + versionInfoView.addSubviews(versionInfoLabel, versionInfoValueLabel) + + versionInfoLabel.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.leading.equalToSuperview().offset(18) + } + + versionInfoValueLabel.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.trailing.equalToSuperview().inset(18) + } + } } extension MyPageVC: NicknameEditorVCDelegate { diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC.swift new file mode 100644 index 00000000..1306006f --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC.swift @@ -0,0 +1,35 @@ +// +// SettingVC.swift +// Runnect-iOS +// +// Created by 몽이 누나 on 2023/04/10. +// + +import UIKit + +import SnapKit +import Then + +final class SettingVC: UIViewController { + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + setUI() + setLayout() + } + +} + +// MARK: - UI & Layout + +extension SettingVC { + private func setUI() { + view.backgroundColor = .w1 + } + + private func setLayout() { + + } +} From 63eb133dee31de1ff14457394662d46ebe8b061c Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Tue, 11 Apr 2023 15:50:54 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[Feat]=20#127=20-=20=EB=A0=88=EC=9D=B4?= =?UTF-8?q?=EC=95=84=EC=9B=83=20=EA=B5=AC=ED=98=84=20=EB=B0=8F=20=EC=8B=A0?= =?UTF-8?q?=EA=B3=A0=ED=8F=BC=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runnect-iOS.xcodeproj/project.pbxproj | 18 +- .../Presentation/MyPage/VC/SettingVC.swift | 35 ---- .../MyPage/VC/SettingVC/PersoanlInfoVC.swift | 29 +++ .../MyPage/VC/SettingVC/PersonalInfoVC.swift | 177 ++++++++++++++++ .../MyPage/VC/SettingVC/SettingVC.swift | 194 ++++++++++++++++++ .../VC/SettingVC/TermsOfServiceVC.swift | 29 +++ 6 files changed, 446 insertions(+), 36 deletions(-) delete mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC.swift create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersoanlInfoVC.swift create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersonalInfoVC.swift create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/TermsOfServiceVC.swift diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index ef34a5f2..26730d69 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -19,6 +19,8 @@ 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 */; }; A3D1A77929CF03D200DD54EC /* AuthRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77829CF03D200DD54EC /* AuthRouter.swift */; }; A3D1A77E29CF09B600DD54EC /* SignInResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */; }; A3D1A78029CF142E00DD54EC /* UserManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77F29CF142E00DD54EC /* UserManager.swift */; }; @@ -165,6 +167,8 @@ 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 = ""; }; A3D1A77829CF03D200DD54EC /* AuthRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRouter.swift; sourceTree = ""; }; A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInResponseDto.swift; sourceTree = ""; }; A3D1A77F29CF142E00DD54EC /* UserManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserManager.swift; sourceTree = ""; }; @@ -377,6 +381,16 @@ path = UploadedCourseInfoCollectionView; sourceTree = ""; }; + A3C2CACF29E4F72400EC525B /* SettingVC */ = { + isa = PBXGroup; + children = ( + A3C2CACD29E313CC00EC525B /* SettingVC.swift */, + A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */, + A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */, + ); + path = SettingVC; + sourceTree = ""; + }; A3D1A77C29CF099400DD54EC /* ResponseDto */ = { isa = PBXGroup; children = ( @@ -682,10 +696,10 @@ CE17F0452961C3DD00E1DED0 /* VC */ = { isa = PBXGroup; children = ( + A3C2CACF29E4F72400EC525B /* SettingVC */, A3BC2F292962C39F00198261 /* InfoVC */, CEEC6B3F2961C55000D00E1E /* MyPageVC.swift */, A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */, - A3C2CACD29E313CC00EC525B /* SettingVC.swift */, ); path = VC; sourceTree = ""; @@ -1330,7 +1344,9 @@ CE40BB1E2968054F0030ABCA /* BaseResponse.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 */, CEC2A68A2962ADCD00160BF7 /* RNMapView.swift in Sources */, CE6655F0295D891B00C64E12 /* UITextView+.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC.swift deleted file mode 100644 index 1306006f..00000000 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// SettingVC.swift -// Runnect-iOS -// -// Created by 몽이 누나 on 2023/04/10. -// - -import UIKit - -import SnapKit -import Then - -final class SettingVC: UIViewController { - - // MARK: - View Life Cycle - - override func viewDidLoad() { - super.viewDidLoad() - setUI() - setLayout() - } - -} - -// MARK: - UI & Layout - -extension SettingVC { - private func setUI() { - view.backgroundColor = .w1 - } - - private func setLayout() { - - } -} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersoanlInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersoanlInfoVC.swift new file mode 100644 index 00000000..6c953a59 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersoanlInfoVC.swift @@ -0,0 +1,29 @@ +// +// PersoanlInfoVC.swift +// Runnect-iOS +// +// Created by 몽이 누나 on 2023/04/11. +// + +import UIKit + +class PersoanlInfoVC: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersonalInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersonalInfoVC.swift new file mode 100644 index 00000000..921883c9 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersonalInfoVC.swift @@ -0,0 +1,177 @@ +// +// PersonalInfoVC.swift +// Runnect-iOS +// +// Created by 몽이 누나 on 2023/04/11. +// + +import UIKit + +import SnapKit +import Then + +final class PersonalInfoVC: UIViewController { + + // MARK: - UI Components + + private lazy var navibar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle("계정 정보") + private let bottomNavibarDiviedView = UIView() + private let firstDiviedView = UIView() + private let secondDiviedView = UIView() + private let thirdDiviedView = UIView() + + private let idContainerView = UIView() + private let idLabel = UILabel().then { + $0.font = .b2 + $0.textColor = .g1 + $0.text = "아이디" + } + + private let idEmailInfoLabel = UILabel().then { + $0.font = .b2 + $0.textColor = .g2 + $0.text = "dlwogus0128@ajou.ac.kr" + } + + private lazy var logoutView = makeInfoView(title: "로그아웃") + private lazy var deleteAccountView = makeInfoView(title: "탈퇴하기") + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + setUI() + setLayout() + } +} + +// MARK: - Methods + +extension PersonalInfoVC { + private func makeInfoView(title: String) -> UIView { + let containerView = UIView() + + let label = UILabel().then { + $0.text = title + $0.textColor = .g1 + $0.font = .b2 + } + + let icArrowRight = UIImageView().then { + $0.image = ImageLiterals.icArrowRight + } + + containerView.addSubviews(label, icArrowRight) + + label.snp.makeConstraints { make in + make.top.equalToSuperview().offset(21) + make.leading.equalToSuperview().offset(18) + } + + icArrowRight.snp.makeConstraints { make in + make.top.equalToSuperview().offset(18) + make.trailing.equalToSuperview().inset(10) + } + + return containerView + } +} + +// MARK: - Layout Helpers + +extension PersonalInfoVC { + private func setUI() { + view.backgroundColor = .w1 + bottomNavibarDiviedView.backgroundColor = .g5 + firstDiviedView.backgroundColor = .g5 + secondDiviedView.backgroundColor = .g5 + thirdDiviedView.backgroundColor = .g5 + } + + private func setLayout() { + view.addSubviews(navibar, bottomNavibarDiviedView, firstDiviedView) + + navibar.snp.makeConstraints { make in + make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + make.height.equalTo(48) + } + + bottomNavibarDiviedView.snp.makeConstraints { make in + make.top.equalTo(navibar.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(4) + } + + setIdContainerViewLayout() + + firstDiviedView.snp.makeConstraints { make in + make.top.equalTo(idContainerView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(10) + } + + } + + private func setIdContainerViewLayout() { + view.addSubviews(idContainerView, firstDiviedView) + + idContainerView.snp.makeConstraints { make in + make.top.equalTo(bottomNavibarDiviedView.snp.bottom) + make.leading.trailing.equalTo(view.safeAreaLayoutGuide) + make.height.equalTo(60) + } + + idContainerView.addSubviews(idLabel, idEmailInfoLabel) + + idLabel.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.leading.equalToSuperview().offset(18) + } + + idEmailInfoLabel.snp.makeConstraints { make in + make.centerY.equalToSuperview() + make.trailing.equalToSuperview().inset(18) + } + + firstDiviedView.snp.makeConstraints { make in + make.top.equalTo(idContainerView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(10) + } + + setLogoutViewLayout() + setDeleteAccountViewLayout() + } + + private func setLogoutViewLayout() { + view.addSubviews(logoutView, secondDiviedView) + + logoutView.snp.makeConstraints { make in + make.top.equalTo(firstDiviedView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(62) + } + + secondDiviedView.snp.makeConstraints { make in + make.top.equalTo(logoutView.snp.bottom).offset(1) + make.leading.trailing.equalToSuperview() + make.height.equalTo(0.5) + } + } + + private func setDeleteAccountViewLayout() { + view.addSubviews(deleteAccountView, thirdDiviedView) + + deleteAccountView.snp.makeConstraints { make in + make.top.equalTo(secondDiviedView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(62) + } + + thirdDiviedView.snp.makeConstraints { make in + make.top.equalTo(deleteAccountView.snp.bottom).offset(1) + make.leading.trailing.equalToSuperview() + make.height.equalTo(0.5) + } + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift new file mode 100644 index 00000000..19b2ef7c --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift @@ -0,0 +1,194 @@ +// +// SettingVC.swift +// Runnect-iOS +// +// Created by 몽이 누나 on 2023/04/10. +// + +import UIKit + +import SnapKit +import Then +import SafariServices + +final class SettingVC: UIViewController { + + // MARK: - Properties + + + + // MARK: - UI Components + + private lazy var navibar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle("설정") + private let bottomNavibarDiviedView = UIView() + private let firstDiviedView = UIView() + private let secondDiviedView = UIView() + private let thirdDiviedView = UIView() + + 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) + + private lazy var personalInfoView = makeInfoView(title: "계정 정보").then { + let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpPersonalInfoView)) + $0.addGestureRecognizer(tap) + } + + private lazy var reportView = makeInfoView(title: "문의 및 신고하기").then { + let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpReportView)) + $0.addGestureRecognizer(tap) + } + + private lazy var termsOfServiceView = makeInfoView(title: "이용약관").then { + let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpTermsOfServiceView)) + $0.addGestureRecognizer(tap) + } + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + setUI() + setLayout() + } + +} + +// MARK: - Methods + +extension SettingVC { + private func makeInfoView(title: String) -> UIView { + let containerView = UIView() + + let label = UILabel().then { + $0.text = title + $0.textColor = .g1 + $0.font = .b2 + } + + let icArrowRight = UIImageView().then { + $0.image = ImageLiterals.icArrowRight + } + + containerView.addSubviews(label, icArrowRight) + + label.snp.makeConstraints { make in + make.top.equalToSuperview().offset(21) + make.leading.equalToSuperview().offset(18) + } + + icArrowRight.snp.makeConstraints { make in + make.top.equalToSuperview().offset(18) + make.trailing.equalToSuperview().inset(10) + } + + return containerView + } + + private func pushToPersonalInfoVC() { + let personalInfoVC = PersonalInfoVC() + self.navigationController?.pushViewController(personalInfoVC, animated: true) + } + + private func pushToTermsOfServiceVC() { + let termsOfServiceVC = TermsOfServiceVC() + self.navigationController?.pushViewController(termsOfServiceVC, animated: true) + } +} + +// MARK: - @objc Function + +extension SettingVC { + @objc + private func touchUpPersonalInfoView() { + pushToPersonalInfoVC() + } + + @objc + private func touchUpReportView() { + self.present(self.reportSafariView, animated: true, completion: nil) + } + + @objc + private func touchUpTermsOfServiceView() { + pushToTermsOfServiceVC() + } +} + +// MARK: - UI & Layout + +extension SettingVC { + private func setUI() { + view.backgroundColor = .w1 + bottomNavibarDiviedView.backgroundColor = .g5 + firstDiviedView.backgroundColor = .g5 + secondDiviedView.backgroundColor = .g5 + thirdDiviedView.backgroundColor = .g5 + } + + private func setLayout() { + view.addSubviews(navibar, bottomNavibarDiviedView) + + navibar.snp.makeConstraints { make in + make.leading.top.trailing.equalTo(view.safeAreaLayoutGuide) + make.height.equalTo(48) + } + + bottomNavibarDiviedView.snp.makeConstraints { make in + make.top.equalTo(navibar.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(4) + } + + setPersonalInfoViewLayout() + setReportViewLayout() + setTermsOfServiceViewLayout() + } + + private func setPersonalInfoViewLayout() { + view.addSubviews(personalInfoView, firstDiviedView) + + personalInfoView.snp.makeConstraints { make in + make.top.equalTo(bottomNavibarDiviedView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(62) + } + + firstDiviedView.snp.makeConstraints { make in + make.top.equalTo(personalInfoView.snp.bottom).offset(1) + make.leading.trailing.equalToSuperview() + make.height.equalTo(0.5) + } + } + + private func setReportViewLayout() { + view.addSubviews(reportView, secondDiviedView) + + reportView.snp.makeConstraints { make in + make.top.equalTo(firstDiviedView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(62) + } + + secondDiviedView.snp.makeConstraints { make in + make.top.equalTo(reportView.snp.bottom).offset(1) + make.leading.trailing.equalToSuperview() + make.height.equalTo(0.5) + } + } + + private func setTermsOfServiceViewLayout() { + view.addSubviews(termsOfServiceView, thirdDiviedView) + + termsOfServiceView.snp.makeConstraints { make in + make.top.equalTo(secondDiviedView.snp.bottom) + make.leading.trailing.equalToSuperview() + make.height.equalTo(62) + } + + thirdDiviedView.snp.makeConstraints { make in + make.top.equalTo(termsOfServiceView.snp.bottom).offset(1) + make.leading.trailing.equalToSuperview() + make.height.equalTo(0.5) + } + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/TermsOfServiceVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/TermsOfServiceVC.swift new file mode 100644 index 00000000..eeeb0736 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/TermsOfServiceVC.swift @@ -0,0 +1,29 @@ +// +// TermsOfServiceVC.swift +// Runnect-iOS +// +// Created by 몽이 누나 on 2023/04/11. +// + +import UIKit + +class TermsOfServiceVC: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} From 1d99766606f4bbc6707aae3b5384ee3365db76b8 Mon Sep 17 00:00:00 2001 From: dlwogus0128 <79050615+dlwogus0128@users.noreply.github.com> Date: Sat, 15 Apr 2023 00:05:09 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[Feat]=20#127=20-=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=95=84=EC=9B=83,=20=ED=83=88=ED=87=B4=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=20UI=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Runnect-iOS.xcodeproj/project.pbxproj | 8 ++ .../MyPage/VC/SettingVC/DeleteAccountVC.swift | 119 ++++++++++++++++++ .../MyPage/VC/SettingVC/LogoutVC.swift | 119 ++++++++++++++++++ .../MyPage/VC/SettingVC/PersonalInfoVC.swift | 36 +++++- .../MyPage/VC/SettingVC/SettingVC.swift | 8 +- .../MyPage/VC/SettingVC/WithdrawVC.swift | 118 +++++++++++++++++ 6 files changed, 400 insertions(+), 8 deletions(-) create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/DeleteAccountVC.swift create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/LogoutVC.swift create mode 100644 Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/WithdrawVC.swift diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index 26730d69..7f32d704 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -21,6 +21,8 @@ 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 /* LogoutVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD629E53B2900EC525B /* LogoutVC.swift */; }; + A3C2CADB29E9A12400EC525B /* DeleteAccountVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */; }; A3D1A77929CF03D200DD54EC /* AuthRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77829CF03D200DD54EC /* AuthRouter.swift */; }; A3D1A77E29CF09B600DD54EC /* SignInResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */; }; A3D1A78029CF142E00DD54EC /* UserManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77F29CF142E00DD54EC /* UserManager.swift */; }; @@ -169,6 +171,8 @@ 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 /* LogoutVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogoutVC.swift; sourceTree = ""; }; + A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteAccountVC.swift; sourceTree = ""; }; A3D1A77829CF03D200DD54EC /* AuthRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRouter.swift; sourceTree = ""; }; A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInResponseDto.swift; sourceTree = ""; }; A3D1A77F29CF142E00DD54EC /* UserManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserManager.swift; sourceTree = ""; }; @@ -387,6 +391,8 @@ A3C2CACD29E313CC00EC525B /* SettingVC.swift */, A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */, A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */, + A3C2CAD629E53B2900EC525B /* LogoutVC.swift */, + A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */, ); path = SettingVC; sourceTree = ""; @@ -1355,6 +1361,7 @@ CE40BB1C2967E4910030ABCA /* RunningWaitingVC.swift in Sources */, CE6B63D6296731F9003F900F /* ScrapCourseListView.swift in Sources */, CE6655F8295D90CF00C64E12 /* adjusted+.swift in Sources */, + A3C2CAD729E53B2900EC525B /* LogoutVC.swift in Sources */, DAD5A3E2296D4C6500C8166B /* PickedMapListResponseDto.swift in Sources */, CE4545CB295D7AF4003201E1 /* SceneDelegate.swift in Sources */, A3F67AE2296D33AC001598A2 /* MyPageDto.swift in Sources */, @@ -1385,6 +1392,7 @@ CEEC6B3A2961C4F300D00E1E /* CourseDrawingHomeVC.swift in Sources */, CEB0BCBC29D123350048CCD5 /* GuideView.swift in Sources */, CEC2A6902962B06C00160BF7 /* convertLocationObject.swift in Sources */, + A3C2CADB29E9A12400EC525B /* DeleteAccountVC.swift in Sources */, CEC2A6852961F92C00160BF7 /* CustomButton.swift in Sources */, CE6B63D3296725E6003F900F /* CourseListCVC.swift in Sources */, CEF3CD9A296DB305002723A1 /* CourseDetailResponseDto.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/DeleteAccountVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/DeleteAccountVC.swift new file mode 100644 index 00000000..4fd4d503 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/DeleteAccountVC.swift @@ -0,0 +1,119 @@ +// +// DeleteAccountVC.swift +// Runnect-iOS +// +// Created by 몽이 누나 on 2023/04/14. +// + +import UIKit + +import SnapKit +import Then + +final class DeleteAccountVC: UIViewController { + + // MARK: - Properties + + // MARK: - UI Components + + private let containerView = UIView().then { + $0.layer.cornerRadius = 15 + } + + private let logoutQuestionLabel = UILabel().then { + $0.text = "정말로 탈퇴하시겠어요?" + $0.font = .b4 + $0.textColor = .g2 + } + + private lazy var yesButton = UIButton(type: .custom).then { + $0.setTitle("네", for: .normal) + $0.titleLabel?.font = .h5 + $0.setTitleColor(.w1, for: .normal) + $0.layer.backgroundColor = UIColor.m1.cgColor + $0.layer.cornerRadius = 10 + } + + private lazy var noButton = UIButton(type: .custom).then { + $0.setTitle("아니오", for: .normal) + $0.titleLabel?.font = .h5 + $0.setTitleColor(.m1, for: .normal) + $0.layer.backgroundColor = UIColor.m3.cgColor + $0.layer.cornerRadius = 10 + } + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + setUI() + setLayout() + setAddTarget() + } +} + +// MARK: - Methods + +extension DeleteAccountVC { + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + if let touch = touches.first, touch.view == self.view { + dismiss(animated: false) + } + } + + private func setAddTarget() { + self.noButton.addTarget(self, action: #selector(touchUpNoButton), for: .touchUpInside) + } +} + +// MARK: - @objc Function + +extension DeleteAccountVC { + @objc func touchUpNoButton() { + dismiss(animated: false) + } +} + +// MARK: - Layout Helpers + +extension DeleteAccountVC { + private func setUI() { + view.backgroundColor = .black.withAlphaComponent(0.8) + containerView.backgroundColor = .w1 + } + + private func setLayout() { + view.addSubviews(containerView) + + containerView.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.centerY.equalToSuperview() + make.leading.trailing.equalToSuperview().inset(30) + make.height.equalTo(126) + } + + containerView.addSubviews(logoutQuestionLabel, yesButton, noButton) + + logoutQuestionLabel.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.top.equalToSuperview().offset(26) + } + + noButton.snp.makeConstraints { make in + make.leading.equalToSuperview().offset(16) + make.trailing.equalTo(containerView.snp.centerX).offset(-4) + make.height.equalTo(44) + make.width.equalTo(145) + make.bottom.equalToSuperview().inset(16) + } + + yesButton.snp.makeConstraints { make in + make.trailing.equalToSuperview().inset(16) + make.leading.equalTo(containerView.snp.centerX).offset(4) + make.height.equalTo(44) + make.width.equalTo(145) + make.bottom.equalToSuperview().inset(16) + } + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/LogoutVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/LogoutVC.swift new file mode 100644 index 00000000..d3644fc2 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/LogoutVC.swift @@ -0,0 +1,119 @@ +// +// LogoutVC.swift +// Runnect-iOS +// +// Created by 몽이 누나 on 2023/04/11. +// + +import UIKit + +import SnapKit +import Then + +final class LogoutVC: UIViewController { + + // MARK: - Properties + + // MARK: - UI Components + + private let containerView = UIView().then { + $0.layer.cornerRadius = 15 + } + + private let logoutQuestionLabel = UILabel().then { + $0.text = "로그아웃 하시겠어요?" + $0.font = .b4 + $0.textColor = .g2 + } + + private lazy var yesButton = UIButton(type: .custom).then { + $0.setTitle("네", for: .normal) + $0.titleLabel?.font = .h5 + $0.setTitleColor(.w1, for: .normal) + $0.layer.backgroundColor = UIColor.m1.cgColor + $0.layer.cornerRadius = 10 + } + + private lazy var noButton = UIButton(type: .custom).then { + $0.setTitle("아니오", for: .normal) + $0.titleLabel?.font = .h5 + $0.setTitleColor(.m1, for: .normal) + $0.layer.backgroundColor = UIColor.m3.cgColor + $0.layer.cornerRadius = 10 + } + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + setUI() + setLayout() + setAddTarget() + } +} + +// MARK: - Methods + +extension LogoutVC { + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + if let touch = touches.first, touch.view == self.view { + dismiss(animated: false) + } + } + + private func setAddTarget() { + self.noButton.addTarget(self, action: #selector(touchUpNoButton), for: .touchUpInside) + } +} + +// MARK: - @objc Function + +extension LogoutVC { + @objc func touchUpNoButton() { + dismiss(animated: false) + } +} + +// MARK: - Layout Helpers + +extension LogoutVC { + private func setUI() { + view.backgroundColor = .black.withAlphaComponent(0.8) + containerView.backgroundColor = .w1 + } + + private func setLayout() { + view.addSubviews(containerView) + + containerView.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.centerY.equalToSuperview() + make.leading.trailing.equalToSuperview().inset(30) + make.height.equalTo(126) + } + + containerView.addSubviews(logoutQuestionLabel, yesButton, noButton) + + logoutQuestionLabel.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.top.equalToSuperview().offset(26) + } + + noButton.snp.makeConstraints { make in + make.leading.equalToSuperview().offset(16) + make.trailing.equalTo(containerView.snp.centerX).offset(-4) + make.height.equalTo(44) + make.width.equalTo(145) + make.bottom.equalToSuperview().inset(16) + } + + yesButton.snp.makeConstraints { make in + make.trailing.equalToSuperview().inset(16) + make.leading.equalTo(containerView.snp.centerX).offset(4) + make.height.equalTo(44) + make.width.equalTo(145) + make.bottom.equalToSuperview().inset(16) + } + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersonalInfoVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersonalInfoVC.swift index 921883c9..8d305225 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersonalInfoVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/PersonalInfoVC.swift @@ -33,8 +33,14 @@ final class PersonalInfoVC: UIViewController { $0.text = "dlwogus0128@ajou.ac.kr" } - private lazy var logoutView = makeInfoView(title: "로그아웃") - private lazy var deleteAccountView = makeInfoView(title: "탈퇴하기") + private lazy var logoutView = makeInfoView(title: "로그아웃").then { + let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpLogoutView)) + $0.addGestureRecognizer(tap) + } + private lazy var deleteAccountView = makeInfoView(title: "탈퇴하기").then { + let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpDeleteAccountView)) + $0.addGestureRecognizer(tap) + } // MARK: - View Life Cycle @@ -45,6 +51,20 @@ final class PersonalInfoVC: UIViewController { } } +// MARK: - @objc Function + +extension PersonalInfoVC { + @objc + func touchUpLogoutView() { + pushToLogoutVC() + } + + @objc + func touchUpDeleteAccountView() { + pushToDeleteAccountVC() + } +} + // MARK: - Methods extension PersonalInfoVC { @@ -75,6 +95,18 @@ extension PersonalInfoVC { return containerView } + + private func pushToLogoutVC() { + let logoutVC = LogoutVC() + logoutVC.modalPresentationStyle = .overFullScreen + self.present(logoutVC, animated: false) + } + + private func pushToDeleteAccountVC() { + let deleteAccountVC = DeleteAccountVC() + deleteAccountVC.modalPresentationStyle = .overFullScreen + self.present(deleteAccountVC, animated: false) + } } // MARK: - Layout Helpers 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 19b2ef7c..29e3017f 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/SettingVC.swift @@ -13,10 +13,6 @@ import SafariServices final class SettingVC: UIViewController { - // MARK: - Properties - - - // MARK: - UI Components private lazy var navibar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle("설정") @@ -26,13 +22,13 @@ final class SettingVC: UIViewController { private let thirdDiviedView = UIView() 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) + lazy var reportSafariView: SFSafariViewController = SFSafariViewController(url: self.reportUrl! as URL) private lazy var personalInfoView = makeInfoView(title: "계정 정보").then { let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpPersonalInfoView)) $0.addGestureRecognizer(tap) } - + private lazy var reportView = makeInfoView(title: "문의 및 신고하기").then { let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpReportView)) $0.addGestureRecognizer(tap) diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/WithdrawVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/WithdrawVC.swift new file mode 100644 index 00000000..0af824be --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/SettingVC/WithdrawVC.swift @@ -0,0 +1,118 @@ +// +// WithdrawVC.swift +// Runnect-iOS +// +// Created by 몽이 누나 on 2023/04/14. +// + +import UIKit + +import SnapKit +import Then + +final class WithdrawVC: UIViewController { + + // MARK: - Properties + + // MARK: - UI Components + + private let containerView = UIView().then { + $0.layer.cornerRadius = 15 + } + + private let logoutQuestionLabel = UILabel().then { + $0.text = "정말로 탈퇴하시겠어요?" + $0.font = .b4 + $0.textColor = .g2 + } + + private lazy var yesButton = UIButton(type: .custom).then { + $0.setTitle("네", for: .normal) + $0.titleLabel?.font = .h5 + $0.setTitleColor(.w1, for: .normal) + $0.layer.backgroundColor = UIColor.m1.cgColor + $0.layer.cornerRadius = 10 + } + + private lazy var noButton = UIButton(type: .custom).then { + $0.setTitle("아니오", for: .normal) + $0.titleLabel?.font = .h5 + $0.setTitleColor(.m1, for: .normal) + $0.layer.backgroundColor = UIColor.m3.cgColor + $0.layer.cornerRadius = 10 + } + + // MARK: - View Life Cycle + + override func viewDidLoad() { + super.viewDidLoad() + setUI() + setLayout() + } +} + +// MARK: - Methods + +extension WithdrawVC { + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + if let touch = touches.first, touch.view == self.view { + dismiss(animated: false) + } + } + + private func setAddTarget() { + self.noButton.addTarget(self, action: #selector(touchUpNoButton), for: .touchUpInside) + } +} + +// MARK: - @objc Function + +extension WithdrawVC { + @objc func touchUpNoButton() { + self.navigationController?.popViewController(animated: true) + } +} + +// MARK: - Layout Helpers + +extension WithdrawVC { + private func setUI() { + view.backgroundColor = .black.withAlphaComponent(0.8) + containerView.backgroundColor = .w1 + } + + private func setLayout() { + view.addSubviews(containerView) + + containerView.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.centerY.equalToSuperview() + make.leading.trailing.equalToSuperview().inset(30) + make.height.equalTo(126) + } + + containerView.addSubviews(logoutQuestionLabel, yesButton, noButton) + + logoutQuestionLabel.snp.makeConstraints { make in + make.centerX.equalToSuperview() + make.top.equalToSuperview().offset(26) + } + + noButton.snp.makeConstraints { make in + make.leading.equalToSuperview().offset(16) + make.trailing.equalTo(containerView.snp.centerX).offset(-4) + make.height.equalTo(44) + make.width.equalTo(145) + make.bottom.equalToSuperview().inset(16) + } + + yesButton.snp.makeConstraints { make in + make.trailing.equalToSuperview().inset(16) + make.leading.equalTo(containerView.snp.centerX).offset(4) + make.height.equalTo(44) + make.width.equalTo(145) + make.bottom.equalToSuperview().inset(16) + } + } +}