Skip to content

Commit 4b74f69

Browse files
authored
Merge pull request #30 from EST-iOS-TEAM2/fix/#28
[FIX] #28 Fix OnboardingView and Fix ProfileView
2 parents 38a3496 + e060fbe commit 4b74f69

File tree

10 files changed

+300
-302
lines changed

10 files changed

+300
-302
lines changed

Dietto/Dietto.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
271271
CODE_SIGN_STYLE = Automatic;
272272
CURRENT_PROJECT_VERSION = 1;
273-
DEVELOPMENT_TEAM = UUYBHY988H;
273+
DEVELOPMENT_TEAM = 5664C7G97A;
274274
ENABLE_PREVIEWS = YES;
275275
GENERATE_INFOPLIST_FILE = YES;
276276
INFOPLIST_FILE = Dietto/Info.plist;
@@ -303,7 +303,7 @@
303303
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
304304
CODE_SIGN_STYLE = Automatic;
305305
CURRENT_PROJECT_VERSION = 1;
306-
DEVELOPMENT_TEAM = UUYBHY988H;
306+
DEVELOPMENT_TEAM = 5664C7G97A;
307307
ENABLE_PREVIEWS = YES;
308308
GENERATE_INFOPLIST_FILE = YES;
309309
INFOPLIST_FILE = Dietto/Info.plist;

Dietto/Dietto/Presentation/Article/View/Interests.swift

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
////
2+
//// InterestsView.swift
3+
//// Dietto
4+
////
5+
//// Created by InTak Han on 5/14/25.
6+
////
7+
//
8+
//import SwiftUI
9+
//
10+
//struct InterestsView: View {
11+
//
12+
// @ObservedObject var viewModel : OnboardingViewModel
13+
//
14+
// @Binding var selection: Int //binding
15+
//
16+
// var body: some View {
17+
// VStack(spacing: 40) {
18+
// VStack(alignment: .leading) {
19+
// Text("\(viewModel.name)님의")
20+
// + Text(" 관심사").foregroundColor(.appMain)
21+
// + Text("를 알려주세요 !")
22+
// }
23+
// .font(.pretendardBold24)
24+
// .padding(.top, 20)
25+
// .padding(.horizontal, 20)
26+
// .frame(maxWidth: .infinity, alignment: .leading)
27+
//
28+
// ScrollView {
29+
// VStack(alignment: .leading, spacing: 30) {
30+
// ForEach(viewModel.interestData, id: \.topic) { block in
31+
// Interests(
32+
// topic: block.topic,
33+
// titles: block.titles,
34+
// onClicked: { title in
35+
// viewModel.toggleInterest(title)
36+
// },
37+
// isSelected: { title in
38+
// viewModel.selectedArticles.contains(where: { $0.title == title })
39+
// }
40+
// )
41+
// }
42+
// }
43+
// .padding(.horizontal, 20)
44+
// .padding(.bottom, 20)
45+
// }
46+
// }
47+
// .background(Color(.backGround).ignoresSafeArea())
48+
// }
49+
//}

Dietto/Dietto/Presentation/Onboarding/View/GoalView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ struct GoalView: View {
2121
VStack(spacing: 40) {
2222

2323
VStack(alignment: .leading, spacing: 4) {
24-
Text("\(viewModel.nickname)님의")
24+
Text("\(viewModel.name)님의")
2525
Text("목표").foregroundColor(.appMain) + Text("를 알려주세요 !")
2626
}
2727
.font(.pretendardBold24)

Dietto/Dietto/Presentation/Onboarding/View/IntroView.swift

Lines changed: 56 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,76 @@
88
import SwiftUI
99

1010
struct IntroView: View {
11-
12-
@State private var first : Bool = false
13-
@State private var second : Bool = false
14-
15-
@State private var isAnimating : Bool = false
11+
@State private var first: Bool = false
12+
@State private var second: Bool = false
13+
@State private var nextbtn: Bool = false
14+
@State private var navigate: Bool = false // ✅ push 트리거
1615

1716
var body: some View {
18-
ZStack {
19-
if first {
20-
Text("안녕하세요! 환영합니다 !")
21-
.foregroundColor(.appMain)
22-
.font(.pretendardBlack24)
23-
.opacity(first ? 1 : 0)
24-
.transition(.opacity)
25-
.animation(.easeInOut(duration: 1), value: first)
26-
}
27-
28-
if second {
29-
Text("프로필을 설정해주세요!")
30-
.foregroundColor(.appMain)
31-
.font(.pretendardBlack24)
32-
.opacity(second ? 1 : 0)
33-
.transition(.opacity)
34-
.animation(.easeInOut(duration: 1), value: second)
17+
NavigationStack {
18+
ZStack {
19+
Color(.backGround)
20+
.ignoresSafeArea()
21+
22+
// 텍스트는 항상 중앙에 고정
23+
ZStack {
24+
if first {
25+
Text("안녕하세요! 환영합니다 !")
26+
.foregroundColor(.appMain)
27+
.font(.pretendardBlack24)
28+
.transition(.opacity)
29+
}
30+
31+
if second {
32+
Text("프로필을 설정해주세요!")
33+
.foregroundColor(.appMain)
34+
.font(.pretendardBlack24)
35+
.transition(.opacity)
36+
}
37+
}
38+
.animation(.easeInOut(duration: 1), value: first)
39+
.animation(.easeInOut(duration: 1), value: second)
40+
41+
VStack {
42+
43+
Spacer()
44+
45+
if nextbtn {
46+
NavigationLink(destination: TutorialView()
47+
.navigationBarBackButtonHidden(true)) {
48+
Text("다음")
49+
.frame(maxWidth: .infinity)
50+
.padding()
51+
.background(Color.appMain)
52+
.foregroundColor(.white)
53+
.cornerRadius(13)
54+
.font(.pretendardMedium16)
55+
}
56+
.padding(.horizontal, 20)
57+
.padding(.bottom, 20)
58+
.transition(.opacity)
59+
}
60+
}
3561
}
62+
.animation(.easeInOut(duration: 1), value: nextbtn)
3663
}
3764
.onAppear {
38-
withAnimation(.easeInOut(duration: 1)) {
39-
first = true
40-
}
65+
first = true
4166

42-
DispatchQueue.main.asyncAfter(deadline: .now()) {
43-
withAnimation(.easeInOut(duration: 1)) {
44-
first = false
45-
}
67+
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
68+
first = false
4669
}
4770

4871
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
49-
withAnimation(.easeInOut(duration: 1)) {
50-
second = true
51-
}
72+
second = true
73+
nextbtn = true
5274
}
5375
}
5476
}
5577
}
5678

79+
80+
5781
#Preview {
5882
IntroView()
5983
}
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
//
2+
// ProfileEditView.swift
3+
// Dietto
4+
//
5+
// Created by kyuhyeon Lee on 5/15/25.
6+
//
7+
8+
import SwiftUI
9+
import Foundation
10+
11+
12+
struct ProfileEditView: View {
13+
@Binding var selection: Int
14+
@ObservedObject var viewModel: OnboardingViewModel
15+
@State private var numberInput: String = ""
16+
17+
var body: some View {
18+
ZStack {
19+
Color(.backGround)
20+
.ignoresSafeArea()
21+
22+
VStack(spacing: 30) {
23+
// MARK: - 프로필 이미지
24+
ZStack(alignment: .bottomTrailing) {
25+
Button { viewModel.showPhotoSheet.toggle() } label: {
26+
Circle()
27+
.stroke(Color.appMain, lineWidth: 2)
28+
.frame(width: 180, height: 180)
29+
.background(
30+
Image(systemName: "person.crop.circle.fill")
31+
.resizable()
32+
.scaledToFit()
33+
.foregroundColor(.gray)
34+
.frame(width: 180, height: 180)
35+
)
36+
}
37+
Button { viewModel.showPhotoSheet.toggle() } label: {
38+
Circle()
39+
.fill(Color.black)
40+
.frame(width: 45, height: 45)
41+
.overlay(
42+
Image(systemName: "camera")
43+
.font(.system(size: 20, weight: .bold))
44+
.foregroundColor(.white)
45+
)
46+
}
47+
.offset(x: -5, y: -5)
48+
}
49+
50+
// MARK: - 이름 입력란
51+
VStack(alignment: .leading, spacing: 6) {
52+
Text("이름")
53+
.font(.pretendardBold16)
54+
TextField("이름을 입력해주세요", text: $viewModel.name)
55+
.font(.pretendardMedium16)
56+
.padding(.horizontal, 20)
57+
.frame(height: 54)
58+
.background(
59+
RoundedRectangle(cornerRadius: 20)
60+
.stroke(Color.appMain, lineWidth: 2)
61+
)
62+
}
63+
64+
// MARK: - 성별 선택
65+
VStack(alignment: .leading, spacing: 6) {
66+
Text("성별")
67+
.font(.pretendardBold16)
68+
ZStack {
69+
RoundedRectangle(cornerRadius: 20)
70+
.stroke(Color.appMain, lineWidth: 2)
71+
.frame(height: 54)
72+
73+
HStack {
74+
Text(viewModel.gender.isEmpty ? "남성" : viewModel.gender)
75+
.font(.pretendardMedium16)
76+
.foregroundColor(viewModel.gender.isEmpty ? .black : .primary)
77+
.padding(.leading, 20)
78+
79+
Spacer()
80+
81+
Menu {
82+
Button { viewModel.selectGender("남성") } label: { Text("남성") }
83+
Button { viewModel.selectGender("여성") } label: { Text("여성") }
84+
} label: {
85+
Image(systemName: "chevron.up.chevron.down")
86+
.font(.pretendardBold16)
87+
.foregroundColor(.gray)
88+
.padding(.trailing, 12)
89+
}
90+
}
91+
}
92+
}
93+
94+
// MARK: - 키 수정
95+
VStack(alignment: .leading, spacing: 6) {
96+
Text("")
97+
.font(.pretendardBold16)
98+
HStack(spacing: 0) {
99+
TextField("170", text: $numberInput)
100+
.keyboardType(.numberPad)
101+
.multilineTextAlignment(.center)
102+
.frame(height: 54)
103+
.padding(.horizontal, 20)
104+
.background(
105+
RoundedRectangle(cornerRadius: 20)
106+
.stroke(Color.appMain, lineWidth: 2)
107+
)
108+
.toolbar {
109+
ToolbarItemGroup(placement: .keyboard) {
110+
Spacer()
111+
Button("완료") {
112+
UIApplication.shared.sendAction(
113+
#selector(UIResponder.resignFirstResponder),
114+
to: nil, from: nil, for: nil
115+
)
116+
}
117+
}
118+
}
119+
Text("cm")
120+
.font(.custom("NerkoOne-regular", size: 50))
121+
.foregroundColor(Color.appMain)
122+
.padding(.leading, 12)
123+
}
124+
}
125+
126+
Spacer()
127+
}
128+
.padding(.top, 48)
129+
.padding(.horizontal, 20)
130+
.confirmationDialog(
131+
"프로필 사진 선택",
132+
isPresented: $viewModel.showPhotoSheet,
133+
titleVisibility: .visible
134+
) {
135+
Button("카메라") { /* 카메라 액션 */ }
136+
Button("갤러리") { /* 갤러리 액션 */ }
137+
Button("취소", role: .cancel) {}
138+
}
139+
}
140+
141+
}
142+
}

0 commit comments

Comments
 (0)