Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] #4 SettingView - MySettingView 구현 #21

Merged
merged 3 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
24 changes: 24 additions & 0 deletions EZPZ/EZPZ.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
70761C0428FB18FB000D399A /* Color+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70761C0328FB18FB000D399A /* Color+.swift */; };
70761C0628FB2034000D399A /* View+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70761C0528FB2034000D399A /* View+.swift */; };
70761C0828FB2805000D399A /* Text+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70761C0728FB2805000D399A /* Text+.swift */; };
7EADD3232902788200E010D3 /* MySettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EADD3222902788200E010D3 /* MySettingView.swift */; };
7EADD3AB29052AFF00E010D3 /* MyProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EADD3AA29052AFF00E010D3 /* MyProfileView.swift */; };
7EADD3AD290576F600E010D3 /* SettingListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EADD3AC290576F600E010D3 /* SettingListView.swift */; };
7EADD3AF290577D800E010D3 /* MyProfileEditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EADD3AE290577D800E010D3 /* MyProfileEditView.swift */; };
D50154C728FAD73D001BA8D5 /* MainChallengeSuperView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D50154C628FAD73D001BA8D5 /* MainChallengeSuperView.swift */; };
D50154C928FAD74A001BA8D5 /* MainChallengeEmptyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D50154C828FAD74A001BA8D5 /* MainChallengeEmptyView.swift */; };
D50154CC28FAD77B001BA8D5 /* TodoEditView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D50154CB28FAD77B001BA8D5 /* TodoEditView.swift */; };
Expand All @@ -34,6 +38,10 @@
70761C0328FB18FB000D399A /* Color+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Color+.swift"; sourceTree = "<group>"; };
70761C0528FB2034000D399A /* View+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+.swift"; sourceTree = "<group>"; };
70761C0728FB2805000D399A /* Text+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Text+.swift"; sourceTree = "<group>"; };
7EADD3222902788200E010D3 /* MySettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MySettingView.swift; sourceTree = "<group>"; };
7EADD3AA29052AFF00E010D3 /* MyProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyProfileView.swift; sourceTree = "<group>"; };
7EADD3AC290576F600E010D3 /* SettingListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingListView.swift; sourceTree = "<group>"; };
7EADD3AE290577D800E010D3 /* MyProfileEditView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyProfileEditView.swift; sourceTree = "<group>"; };
D50154C628FAD73D001BA8D5 /* MainChallengeSuperView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainChallengeSuperView.swift; sourceTree = "<group>"; };
D50154C828FAD74A001BA8D5 /* MainChallengeEmptyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainChallengeEmptyView.swift; sourceTree = "<group>"; };
D50154CB28FAD77B001BA8D5 /* TodoEditView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TodoEditView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -70,6 +78,17 @@
path = Fonts;
sourceTree = "<group>";
};
7EADD3212902784100E010D3 /* SettingView */ = {
isa = PBXGroup;
children = (
7EADD3222902788200E010D3 /* MySettingView.swift */,
7EADD3AA29052AFF00E010D3 /* MyProfileView.swift */,
7EADD3AE290577D800E010D3 /* MyProfileEditView.swift */,
7EADD3AC290576F600E010D3 /* SettingListView.swift */,
);
path = SettingView;
sourceTree = "<group>";
};
D50154C028FAD6AB001BA8D5 /* OnBoardingView */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -177,6 +196,7 @@
D50154C228FAD6F0001BA8D5 /* ChallegeAddView */,
D50154C128FAD6BA001BA8D5 /* MainView */,
D593994728EE10130082A3F9 /* ContentView.swift */,
7EADD3212902784100E010D3 /* SettingView */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -281,11 +301,15 @@
buildActionMask = 2147483647;
files = (
70761C0828FB2805000D399A /* Text+.swift in Sources */,
7EADD3AB29052AFF00E010D3 /* MyProfileView.swift in Sources */,
D593995F28EE11F60082A3F9 /* imsi.swift in Sources */,
D593994F28EE10140082A3F9 /* Persistence.swift in Sources */,
D593994828EE10130082A3F9 /* ContentView.swift in Sources */,
7EADD3AD290576F600E010D3 /* SettingListView.swift in Sources */,
D50154C728FAD73D001BA8D5 /* MainChallengeSuperView.swift in Sources */,
7EADD3232902788200E010D3 /* MySettingView.swift in Sources */,
70761C0628FB2034000D399A /* View+.swift in Sources */,
7EADD3AF290577D800E010D3 /* MyProfileEditView.swift in Sources */,
D50154CC28FAD77B001BA8D5 /* TodoEditView.swift in Sources */,
D50154D428FAD825001BA8D5 /* imsi+.swift in Sources */,
D593995228EE10140082A3F9 /* EZPZ.xcdatamodeld in Sources */,
Expand Down
8 changes: 8 additions & 0 deletions EZPZ/EZPZ/Views/SettingView/MyProfileEditView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// MyProfileEditView.swift
// EZPZ
//
// Created by 최홍준 on 2022/10/23.
//

import Foundation
44 changes: 44 additions & 0 deletions EZPZ/EZPZ/Views/SettingView/MyProfileView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
//
// MyProfileView.swift
// EZPZ
//
// Created by 최홍준 on 2022/10/23.
//

import SwiftUI

struct MyProfileView: View {
Copy link
Collaborator Author

@Hongjaaa Hongjaaa Oct 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MyProfileView의 레이아웃을 설정 탭에서 확인하고자 코드를 작성하였습니다.
작업하면서 수정될 코드들입니다.

var body: some View {
ZStack {
RoundedRectangle(cornerRadius: 10)
.fill(Color.grayScale5)
.frame(width: 356, height: 500)
HStack {
Spacer()
Button(action: {
// some action
}) {
Image(systemName: "gearshape.fill")
.foregroundColor(Color.grayScale1)
.padding(.leading, 329)
.padding(.trailing, 46)
.padding(.bottom, 450)
Comment on lines +23 to +25
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

padding을 한번에 묶어서 값을 줄 수 있을 것 같아요!

}
}
VStack {
// 이미지를 받으면 넣을 부분
RoundedRectangle(cornerRadius: 10)
.fill(Color.grayScale2)
.frame(width: 273, height: 280.34)
.padding(.top, -170.66)
.padding(.bottom, 18)
}
}
}
}

struct MyProfileView_Previews: PreviewProvider {
static var previews: some View {
MyProfileView()
}
}
47 changes: 47 additions & 0 deletions EZPZ/EZPZ/Views/SettingView/MySettingView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
//
// MySettingView.swift
// EZPZ
//
// Created by 최홍준 on 2022/10/21.
//

import SwiftUI

struct MySettingView: View {
var body: some View {
ZStack(alignment: .top) {
Color.ezpzBlack.ignoresSafeArea()
ScrollView {
VStack {
HStack {
Text("나의 프로필")
.setBasicTitle2()
.padding(.leading, 17)
Spacer()
}
.padding(.top, 3)
.padding(.bottom, 8)

MyProfileView()

HStack {
Text("설정")
.setBasicTitle2()
.padding(.leading, 17)
Spacer()
}
.padding(.top, 26)
.padding(.bottom, 18)

SettingListView()
}
}
}
}
}

struct MySettingView_Previews: PreviewProvider {
static var previews: some View {
MySettingView()
}
}
84 changes: 84 additions & 0 deletions EZPZ/EZPZ/Views/SettingView/SettingListView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//
// SettingListView.swift
// EZPZ
//
// Created by 최홍준 on 2022/10/23.
//

import SwiftUI

struct SettingListView: View {
var body: some View {
ZStack {
RoundedRectangle(cornerRadius: 10)
.fill(Color.grayScale5)
.frame(width: 356, height: 232)
VStack {
HStack {
Text("앱 버전 정보")
.setBasicBody()
.padding(.leading, 36)
.padding(.top, 4)
.padding(.bottom, 2.55)
Spacer()
}
Divider()
.frame(width: 356, height: 1)
.background(Color.white.opacity(0.2))
HStack {
Text("푸쉬 알림 설정")
.setBasicBody()
.padding(.leading, 36)
.padding(.top, 1.45)
.padding(.bottom, 2.55)
Spacer()
}
Divider()
.frame(width: 356, height: 1)
.background(Color.white.opacity(0.2))
HStack {
Text("라이센스 정보")
.setBasicBody()
.padding(.leading, 36)
.padding(.top, 1.45)
.padding(.bottom, 2.55)
Spacer()
}
Comment on lines +17 to +46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반복적으로 사용한는 HStackDivider를 따로 뷰로 만들 수 있을 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

List가 아닌 Stack을 사용하였는데, Stack을 더욱 잘게 만들어서 따로 뷰로 만들어보겠습니다!
감사합니다!

Divider()
.frame(width: 356, height: 1)
.background(Color.white.opacity(0.2))
HStack {
Text("이용 약관")
.setBasicBody()
.padding(.leading, 36)
.padding(.top, 1.45)
.padding(.bottom, 2.55)
Spacer()
}
Divider()
.frame(width: 356, height: 1)
.background(Color.white.opacity(0.2))
.padding(.bottom, -4)
Divider()
.frame(width: 356, height: 1)
.background(Color.white.opacity(0.2))
.padding(.top, -4)
Comment on lines +58 to +65
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Divider()를 두 개 만들어주셨군요!

HStack {
Text("도전 포기하기")
.font(Font.custom("SpoqaHanSans-Regular", size: 17))
.foregroundColor(Color.red)
.padding(.leading, 36)
.padding(.top, -7.45)
.padding(.bottom, 5)
Spacer()
}
}
}
}
}

struct SettingListView_Previews: PreviewProvider {
static var previews: some View {
SettingListView()
}
}