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
28 changes: 28 additions & 0 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
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 */; };
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 */; };
Expand Down Expand Up @@ -163,6 +168,11 @@
A3BC2F3E2964706100198261 /* UploadedCourseInfoCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadedCourseInfoCVC.swift; sourceTree = "<group>"; };
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 /* LogoutVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogoutVC.swift; sourceTree = "<group>"; };
A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteAccountVC.swift; sourceTree = "<group>"; };
A3D1A77829CF03D200DD54EC /* AuthRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRouter.swift; sourceTree = "<group>"; };
A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInResponseDto.swift; sourceTree = "<group>"; };
A3D1A77F29CF142E00DD54EC /* UserManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -375,6 +385,18 @@
path = UploadedCourseInfoCollectionView;
sourceTree = "<group>";
};
A3C2CACF29E4F72400EC525B /* SettingVC */ = {
isa = PBXGroup;
children = (
A3C2CACD29E313CC00EC525B /* SettingVC.swift */,
A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */,
A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */,
A3C2CAD629E53B2900EC525B /* LogoutVC.swift */,
A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */,
);
path = SettingVC;
sourceTree = "<group>";
};
A3D1A77C29CF099400DD54EC /* ResponseDto */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -680,6 +702,7 @@
CE17F0452961C3DD00E1DED0 /* VC */ = {
isa = PBXGroup;
children = (
A3C2CACF29E4F72400EC525B /* SettingVC */,
A3BC2F292962C39F00198261 /* InfoVC */,
CEEC6B3F2961C55000D00E1E /* MyPageVC.swift */,
A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */,
Expand Down Expand Up @@ -1327,7 +1350,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 */,
Expand All @@ -1336,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 */,
Expand Down Expand Up @@ -1366,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 */,
Expand Down Expand Up @@ -1398,6 +1425,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 */,
Expand Down
102 changes: 95 additions & 7 deletions Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -206,6 +232,11 @@ extension MyPageVC {
private func touchUpNicknameEditorView() {
pushToNicknameEditorVC()
}

@objc
private func touchUpSettingView() {
pushToSettingVC()
}
}

// MARK: - UI & Layout
Expand All @@ -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)
Expand All @@ -249,6 +283,7 @@ extension MyPageVC {
}

setInfoButtonLayout()
setVersionInfoLayout()
}

private func setMyProfileLayout() {
Expand All @@ -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)
}
}

Expand All @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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<UITouch>, 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)
}
}
}
Loading