Skip to content

Commit e577f1b

Browse files
authored
Merge pull request #128 from dlwogus0128/refactor/#127-마이페이지-UI-수정
[Refactor] #127 - 마이페이지 UI 수정
2 parents 4f9bf52 + 1d99766 commit e577f1b

9 files changed

Lines changed: 936 additions & 7 deletions

File tree

Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
A3BC2F3F2964706100198261 /* UploadedCourseInfoCVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F3E2964706100198261 /* UploadedCourseInfoCVC.swift */; };
1919
A3BC2F4129667A0D00198261 /* NicknameEditorVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */; };
2020
A3BC2F432966A93100198261 /* CourseDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3BC2F422966A93100198261 /* CourseDetailVC.swift */; };
21+
A3C2CACE29E313CC00EC525B /* SettingVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CACD29E313CC00EC525B /* SettingVC.swift */; };
22+
A3C2CAD329E4F77C00EC525B /* TermsOfServiceVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */; };
23+
A3C2CAD529E4F85400EC525B /* PersonalInfoVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */; };
24+
A3C2CAD729E53B2900EC525B /* LogoutVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CAD629E53B2900EC525B /* LogoutVC.swift */; };
25+
A3C2CADB29E9A12400EC525B /* DeleteAccountVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */; };
2126
A3D1A77929CF03D200DD54EC /* AuthRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77829CF03D200DD54EC /* AuthRouter.swift */; };
2227
A3D1A77E29CF09B600DD54EC /* SignInResponseDto.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */; };
2328
A3D1A78029CF142E00DD54EC /* UserManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A3D1A77F29CF142E00DD54EC /* UserManager.swift */; };
@@ -163,6 +168,11 @@
163168
A3BC2F3E2964706100198261 /* UploadedCourseInfoCVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadedCourseInfoCVC.swift; sourceTree = "<group>"; };
164169
A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NicknameEditorVC.swift; sourceTree = "<group>"; };
165170
A3BC2F422966A93100198261 /* CourseDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetailVC.swift; sourceTree = "<group>"; };
171+
A3C2CACD29E313CC00EC525B /* SettingVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingVC.swift; sourceTree = "<group>"; };
172+
A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TermsOfServiceVC.swift; sourceTree = "<group>"; };
173+
A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PersonalInfoVC.swift; sourceTree = "<group>"; };
174+
A3C2CAD629E53B2900EC525B /* LogoutVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogoutVC.swift; sourceTree = "<group>"; };
175+
A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeleteAccountVC.swift; sourceTree = "<group>"; };
166176
A3D1A77829CF03D200DD54EC /* AuthRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthRouter.swift; sourceTree = "<group>"; };
167177
A3D1A77D29CF09B600DD54EC /* SignInResponseDto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInResponseDto.swift; sourceTree = "<group>"; };
168178
A3D1A77F29CF142E00DD54EC /* UserManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserManager.swift; sourceTree = "<group>"; };
@@ -375,6 +385,18 @@
375385
path = UploadedCourseInfoCollectionView;
376386
sourceTree = "<group>";
377387
};
388+
A3C2CACF29E4F72400EC525B /* SettingVC */ = {
389+
isa = PBXGroup;
390+
children = (
391+
A3C2CACD29E313CC00EC525B /* SettingVC.swift */,
392+
A3C2CAD229E4F77C00EC525B /* TermsOfServiceVC.swift */,
393+
A3C2CAD429E4F85400EC525B /* PersonalInfoVC.swift */,
394+
A3C2CAD629E53B2900EC525B /* LogoutVC.swift */,
395+
A3C2CADA29E9A12400EC525B /* DeleteAccountVC.swift */,
396+
);
397+
path = SettingVC;
398+
sourceTree = "<group>";
399+
};
378400
A3D1A77C29CF099400DD54EC /* ResponseDto */ = {
379401
isa = PBXGroup;
380402
children = (
@@ -680,6 +702,7 @@
680702
CE17F0452961C3DD00E1DED0 /* VC */ = {
681703
isa = PBXGroup;
682704
children = (
705+
A3C2CACF29E4F72400EC525B /* SettingVC */,
683706
A3BC2F292962C39F00198261 /* InfoVC */,
684707
CEEC6B3F2961C55000D00E1E /* MyPageVC.swift */,
685708
A3BC2F4029667A0D00198261 /* NicknameEditorVC.swift */,
@@ -1327,7 +1350,9 @@
13271350
CE40BB1E2968054F0030ABCA /* BaseResponse.swift in Sources */,
13281351
CE14677C2965C1B100DCEA1B /* RunningRecordVC.swift in Sources */,
13291352
CE6B63D829673450003F900F /* ListEmptyView.swift in Sources */,
1353+
A3C2CAD329E4F77C00EC525B /* TermsOfServiceVC.swift in Sources */,
13301354
CE6655F6295D90B600C64E12 /* addToolBar.swift in Sources */,
1355+
A3C2CAD529E4F85400EC525B /* PersonalInfoVC.swift in Sources */,
13311356
DAD5A3DA296C6DA500C8166B /* TitleCollectionViewCell.swift in Sources */,
13321357
CEC2A68A2962ADCD00160BF7 /* RNMapView.swift in Sources */,
13331358
CE6655F0295D891B00C64E12 /* UITextView+.swift in Sources */,
@@ -1336,6 +1361,7 @@
13361361
CE40BB1C2967E4910030ABCA /* RunningWaitingVC.swift in Sources */,
13371362
CE6B63D6296731F9003F900F /* ScrapCourseListView.swift in Sources */,
13381363
CE6655F8295D90CF00C64E12 /* adjusted+.swift in Sources */,
1364+
A3C2CAD729E53B2900EC525B /* LogoutVC.swift in Sources */,
13391365
DAD5A3E2296D4C6500C8166B /* PickedMapListResponseDto.swift in Sources */,
13401366
CE4545CB295D7AF4003201E1 /* SceneDelegate.swift in Sources */,
13411367
A3F67AE2296D33AC001598A2 /* MyPageDto.swift in Sources */,
@@ -1366,6 +1392,7 @@
13661392
CEEC6B3A2961C4F300D00E1E /* CourseDrawingHomeVC.swift in Sources */,
13671393
CEB0BCBC29D123350048CCD5 /* GuideView.swift in Sources */,
13681394
CEC2A6902962B06C00160BF7 /* convertLocationObject.swift in Sources */,
1395+
A3C2CADB29E9A12400EC525B /* DeleteAccountVC.swift in Sources */,
13691396
CEC2A6852961F92C00160BF7 /* CustomButton.swift in Sources */,
13701397
CE6B63D3296725E6003F900F /* CourseListCVC.swift in Sources */,
13711398
CEF3CD9A296DB305002723A1 /* CourseDetailResponseDto.swift in Sources */,
@@ -1398,6 +1425,7 @@
13981425
CE17F02D2961BBA100E1DED0 /* ColorLiterals.swift in Sources */,
13991426
CEC2A68E2962AF2C00160BF7 /* RNMarker.swift in Sources */,
14001427
CE6655D2295D862A00C64E12 /* Publisher+Driver.swift in Sources */,
1428+
A3C2CACE29E313CC00EC525B /* SettingVC.swift in Sources */,
14011429
CE21C02E299E601700F62AF5 /* StampRouter.swift in Sources */,
14021430
CE6655E6295D887F00C64E12 /* UIStackView+.swift in Sources */,
14031431
A3BC2F34296303A600198261 /* GoalRewardInfoCVC.swift in Sources */,

Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift

Lines changed: 95 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ final class MyPageVC: UIViewController {
2424
private lazy var navibar = CustomNavigationBar(self, type: .title).setTitle("마이페이지")
2525
private let myProfileView = UIView()
2626
private let myRunningProgressView = UIView()
27+
private let versionInfoView = UIView()
2728
private let firstDivideView = UIView()
2829
private let secondDivideView = UIView()
2930
private let thirdDivideView = UIView()
31+
private let fourthDivideView = UIView()
32+
private let topVersionDivideView = UIView()
33+
private let bottomVersionDivideView = UIView()
3034

3135
private let myProfileImage = UIImageView()
3236

@@ -79,6 +83,23 @@ final class MyPageVC: UIViewController {
7983
$0.addGestureRecognizer(tap)
8084
}
8185

86+
private lazy var settingView = makeInfoView(title: "설정").then {
87+
let tap = UITapGestureRecognizer(target: self, action: #selector(self.touchUpSettingView))
88+
$0.addGestureRecognizer(tap)
89+
}
90+
91+
private let versionInfoLabel = UILabel().then {
92+
$0.textColor = .g2
93+
$0.font = .b2
94+
$0.text = "버전 정보"
95+
}
96+
97+
private let versionInfoValueLabel = UILabel().then {
98+
$0.textColor = .g2
99+
$0.font = .b2
100+
$0.text = "v. 1.0.1"
101+
}
102+
82103
// MARK: - View Life Cycle
83104

84105
override func viewDidLoad() {
@@ -130,7 +151,7 @@ extension MyPageVC {
130151

131152
icArrowRight.snp.makeConstraints { make in
132153
make.top.equalToSuperview().offset(18)
133-
make.trailing.equalToSuperview().inset(8)
154+
make.trailing.equalToSuperview().inset(10)
134155
}
135156

136157
return containerView
@@ -158,6 +179,11 @@ extension MyPageVC {
158179
self.present(nicknameEditorVC, animated: false)
159180
}
160181

182+
private func pushToSettingVC() {
183+
let settingVC = SettingVC()
184+
self.navigationController?.pushViewController(settingVC, animated: true)
185+
}
186+
161187
private func setData(model: MyPageDto) {
162188
self.myProfileNameLabel.text = model.user.nickname
163189
self.myRunningProgressBar.setProgress(Float(model.user.levelPercent)/100, animated: false)
@@ -206,6 +232,11 @@ extension MyPageVC {
206232
private func touchUpNicknameEditorView() {
207233
pushToNicknameEditorVC()
208234
}
235+
236+
@objc
237+
private func touchUpSettingView() {
238+
pushToSettingVC()
239+
}
209240
}
210241

211242
// MARK: - UI & Layout
@@ -226,12 +257,15 @@ extension MyPageVC {
226257
firstDivideView.backgroundColor = .g5
227258
secondDivideView.backgroundColor = .g4
228259
thirdDivideView.backgroundColor = .g4
260+
fourthDivideView.backgroundColor = .g4
261+
topVersionDivideView.backgroundColor = .g5
262+
bottomVersionDivideView.backgroundColor = .g5
229263
}
230264

231265
private func setLayout() {
232266
view.addSubviews(myProfileView, myRunningProgressView, firstDivideView,
233267
goalRewardInfoView, secondDivideView, activityRecordInfoView,
234-
thirdDivideView, uploadedCourseInfoView)
268+
thirdDivideView, uploadedCourseInfoView, fourthDivideView, settingView)
235269

236270
myProfileView.snp.makeConstraints { make in
237271
make.top.equalTo(navibar.snp.bottom).offset(6)
@@ -249,6 +283,7 @@ extension MyPageVC {
249283
}
250284

251285
setInfoButtonLayout()
286+
setVersionInfoLayout()
252287
}
253288

254289
private func setMyProfileLayout() {
@@ -274,9 +309,9 @@ extension MyPageVC {
274309
}
275310

276311
myRunningProgressView.snp.makeConstraints { make in
277-
make.top.equalTo(myProfileView.snp.bottom).offset(18)
278-
make.leading.trailing.equalToSuperview().inset(16)
279-
make.height.equalTo(55)
312+
make.top.equalTo(myProfileView.snp.bottom).offset(31)
313+
make.leading.trailing.equalToSuperview().inset(32)
314+
make.height.equalTo(61)
280315
}
281316
}
282317

@@ -286,7 +321,7 @@ extension MyPageVC {
286321

287322
myRunningLevelLavel.snp.makeConstraints { make in
288323
make.top.equalToSuperview()
289-
make.leading.equalToSuperview().offset(1)
324+
make.leading.equalToSuperview().offset(3)
290325
}
291326

292327
myRunningProgressBar.snp.makeConstraints { make in
@@ -331,7 +366,60 @@ extension MyPageVC {
331366
make.leading.trailing.equalToSuperview()
332367
make.height.equalTo(60)
333368
}
334-
}
369+
370+
activityRecordInfoView.snp.makeConstraints { make in
371+
make.top.equalTo(secondDivideView.snp.bottom)
372+
make.leading.trailing.equalToSuperview()
373+
make.height.equalTo(60)
374+
}
375+
376+
fourthDivideView.snp.makeConstraints { make in
377+
make.top.equalTo(uploadedCourseInfoView.snp.bottom).offset(1)
378+
make.leading.trailing.equalToSuperview()
379+
make.height.equalTo(0.5)
380+
}
381+
382+
settingView.snp.makeConstraints { make in
383+
make.top.equalTo(fourthDivideView.snp.bottom)
384+
make.leading.trailing.equalToSuperview()
385+
make.height.equalTo(60)
386+
}
387+
388+
}
389+
390+
private func setVersionInfoLayout() {
391+
view.addSubviews(topVersionDivideView, versionInfoView, bottomVersionDivideView)
392+
393+
topVersionDivideView.snp.makeConstraints { make in
394+
make.top.equalTo(settingView.snp.bottom)
395+
make.leading.trailing.equalToSuperview()
396+
make.height.equalTo(4)
397+
}
398+
399+
versionInfoView.snp.makeConstraints { make in
400+
make.top.equalTo(settingView.snp.bottom)
401+
make.leading.trailing.equalToSuperview()
402+
make.height.equalTo(62)
403+
}
404+
405+
bottomVersionDivideView.snp.makeConstraints { make in
406+
make.top.equalTo(versionInfoView.snp.bottom)
407+
make.leading.trailing.equalToSuperview()
408+
make.height.equalTo(4)
409+
}
410+
411+
versionInfoView.addSubviews(versionInfoLabel, versionInfoValueLabel)
412+
413+
versionInfoLabel.snp.makeConstraints { make in
414+
make.centerY.equalToSuperview()
415+
make.leading.equalToSuperview().offset(18)
416+
}
417+
418+
versionInfoValueLabel.snp.makeConstraints { make in
419+
make.centerY.equalToSuperview()
420+
make.trailing.equalToSuperview().inset(18)
421+
}
422+
}
335423
}
336424

337425
extension MyPageVC: NicknameEditorVCDelegate {
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
//
2+
// DeleteAccountVC.swift
3+
// Runnect-iOS
4+
//
5+
// Created by 몽이 누나 on 2023/04/14.
6+
//
7+
8+
import UIKit
9+
10+
import SnapKit
11+
import Then
12+
13+
final class DeleteAccountVC: UIViewController {
14+
15+
// MARK: - Properties
16+
17+
// MARK: - UI Components
18+
19+
private let containerView = UIView().then {
20+
$0.layer.cornerRadius = 15
21+
}
22+
23+
private let logoutQuestionLabel = UILabel().then {
24+
$0.text = "정말로 탈퇴하시겠어요?"
25+
$0.font = .b4
26+
$0.textColor = .g2
27+
}
28+
29+
private lazy var yesButton = UIButton(type: .custom).then {
30+
$0.setTitle("", for: .normal)
31+
$0.titleLabel?.font = .h5
32+
$0.setTitleColor(.w1, for: .normal)
33+
$0.layer.backgroundColor = UIColor.m1.cgColor
34+
$0.layer.cornerRadius = 10
35+
}
36+
37+
private lazy var noButton = UIButton(type: .custom).then {
38+
$0.setTitle("아니오", for: .normal)
39+
$0.titleLabel?.font = .h5
40+
$0.setTitleColor(.m1, for: .normal)
41+
$0.layer.backgroundColor = UIColor.m3.cgColor
42+
$0.layer.cornerRadius = 10
43+
}
44+
45+
// MARK: - View Life Cycle
46+
47+
override func viewDidLoad() {
48+
super.viewDidLoad()
49+
setUI()
50+
setLayout()
51+
setAddTarget()
52+
}
53+
}
54+
55+
// MARK: - Methods
56+
57+
extension DeleteAccountVC {
58+
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
59+
super.touchesBegan(touches, with: event)
60+
if let touch = touches.first, touch.view == self.view {
61+
dismiss(animated: false)
62+
}
63+
}
64+
65+
private func setAddTarget() {
66+
self.noButton.addTarget(self, action: #selector(touchUpNoButton), for: .touchUpInside)
67+
}
68+
}
69+
70+
// MARK: - @objc Function
71+
72+
extension DeleteAccountVC {
73+
@objc func touchUpNoButton() {
74+
dismiss(animated: false)
75+
}
76+
}
77+
78+
// MARK: - Layout Helpers
79+
80+
extension DeleteAccountVC {
81+
private func setUI() {
82+
view.backgroundColor = .black.withAlphaComponent(0.8)
83+
containerView.backgroundColor = .w1
84+
}
85+
86+
private func setLayout() {
87+
view.addSubviews(containerView)
88+
89+
containerView.snp.makeConstraints { make in
90+
make.centerX.equalToSuperview()
91+
make.centerY.equalToSuperview()
92+
make.leading.trailing.equalToSuperview().inset(30)
93+
make.height.equalTo(126)
94+
}
95+
96+
containerView.addSubviews(logoutQuestionLabel, yesButton, noButton)
97+
98+
logoutQuestionLabel.snp.makeConstraints { make in
99+
make.centerX.equalToSuperview()
100+
make.top.equalToSuperview().offset(26)
101+
}
102+
103+
noButton.snp.makeConstraints { make in
104+
make.leading.equalToSuperview().offset(16)
105+
make.trailing.equalTo(containerView.snp.centerX).offset(-4)
106+
make.height.equalTo(44)
107+
make.width.equalTo(145)
108+
make.bottom.equalToSuperview().inset(16)
109+
}
110+
111+
yesButton.snp.makeConstraints { make in
112+
make.trailing.equalToSuperview().inset(16)
113+
make.leading.equalTo(containerView.snp.centerX).offset(4)
114+
make.height.equalTo(44)
115+
make.width.equalTo(145)
116+
make.bottom.equalToSuperview().inset(16)
117+
}
118+
}
119+
}

0 commit comments

Comments
 (0)