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
4 changes: 2 additions & 2 deletions Dietto/Dietto.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UUYBHY988H;
DEVELOPMENT_TEAM = 5664C7G97A;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Dietto/Info.plist;
Expand Down Expand Up @@ -303,7 +303,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = UUYBHY988H;
DEVELOPMENT_TEAM = 5664C7G97A;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Dietto/Info.plist;
Expand Down
47 changes: 0 additions & 47 deletions Dietto/Dietto/Presentation/Article/View/Interests.swift

This file was deleted.

49 changes: 49 additions & 0 deletions Dietto/Dietto/Presentation/Dietary/View/InterestView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
////
//// InterestsView.swift
//// Dietto
////
//// Created by InTak Han on 5/14/25.
////
//
//import SwiftUI
//
//struct InterestsView: View {
//
// @ObservedObject var viewModel : OnboardingViewModel
//
// @Binding var selection: Int //binding
//
// var body: some View {
// VStack(spacing: 40) {
// VStack(alignment: .leading) {
// Text("\(viewModel.name)님의")
// + Text(" 관심사").foregroundColor(.appMain)
// + Text("를 알려주세요 !")
// }
// .font(.pretendardBold24)
// .padding(.top, 20)
// .padding(.horizontal, 20)
// .frame(maxWidth: .infinity, alignment: .leading)
//
// ScrollView {
// VStack(alignment: .leading, spacing: 30) {
// ForEach(viewModel.interestData, id: \.topic) { block in
// Interests(
// topic: block.topic,
// titles: block.titles,
// onClicked: { title in
// viewModel.toggleInterest(title)
// },
// isSelected: { title in
// viewModel.selectedArticles.contains(where: { $0.title == title })
// }
// )
// }
// }
// .padding(.horizontal, 20)
// .padding(.bottom, 20)
// }
// }
// .background(Color(.backGround).ignoresSafeArea())
// }
//}
2 changes: 1 addition & 1 deletion Dietto/Dietto/Presentation/Onboarding/View/GoalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct GoalView: View {
VStack(spacing: 40) {

VStack(alignment: .leading, spacing: 4) {
Text("\(viewModel.nickname)님의")
Text("\(viewModel.name)님의")
Text("목표").foregroundColor(.appMain) + Text("를 알려주세요 !")
}
.font(.pretendardBold24)
Expand Down
88 changes: 56 additions & 32 deletions Dietto/Dietto/Presentation/Onboarding/View/IntroView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,52 +8,76 @@
import SwiftUI

struct IntroView: View {

@State private var first : Bool = false
@State private var second : Bool = false

@State private var isAnimating : Bool = false
@State private var first: Bool = false
@State private var second: Bool = false
@State private var nextbtn: Bool = false
@State private var navigate: Bool = false // ✅ push 트리거

var body: some View {
ZStack {
if first {
Text("안녕하세요! 환영합니다 !")
.foregroundColor(.appMain)
.font(.pretendardBlack24)
.opacity(first ? 1 : 0)
.transition(.opacity)
.animation(.easeInOut(duration: 1), value: first)
}

if second {
Text("프로필을 설정해주세요!")
.foregroundColor(.appMain)
.font(.pretendardBlack24)
.opacity(second ? 1 : 0)
.transition(.opacity)
.animation(.easeInOut(duration: 1), value: second)
NavigationStack {
ZStack {
Color(.backGround)
.ignoresSafeArea()

// 텍스트는 항상 중앙에 고정
ZStack {
if first {
Text("안녕하세요! 환영합니다 !")
.foregroundColor(.appMain)
.font(.pretendardBlack24)
.transition(.opacity)
}

if second {
Text("프로필을 설정해주세요!")
.foregroundColor(.appMain)
.font(.pretendardBlack24)
.transition(.opacity)
}
}
.animation(.easeInOut(duration: 1), value: first)
.animation(.easeInOut(duration: 1), value: second)

VStack {

Spacer()

if nextbtn {
NavigationLink(destination: TutorialView()
.navigationBarBackButtonHidden(true)) {
Text("다음")
.frame(maxWidth: .infinity)
.padding()
.background(Color.appMain)
.foregroundColor(.white)
.cornerRadius(13)
.font(.pretendardMedium16)
}
.padding(.horizontal, 20)
.padding(.bottom, 20)
.transition(.opacity)
}
}
}
.animation(.easeInOut(duration: 1), value: nextbtn)
}
.onAppear {
withAnimation(.easeInOut(duration: 1)) {
first = true
}
first = true

DispatchQueue.main.asyncAfter(deadline: .now()) {
withAnimation(.easeInOut(duration: 1)) {
first = false
}
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
first = false
}

DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
withAnimation(.easeInOut(duration: 1)) {
second = true
}
second = true
nextbtn = true
}
}
}
}



#Preview {
IntroView()
}
142 changes: 142 additions & 0 deletions Dietto/Dietto/Presentation/Onboarding/View/ProfileEditView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
//
// ProfileEditView.swift
// Dietto
//
// Created by kyuhyeon Lee on 5/15/25.
//

import SwiftUI
import Foundation


struct ProfileEditView: View {
@Binding var selection: Int
@ObservedObject var viewModel: OnboardingViewModel
@State private var numberInput: String = ""

var body: some View {
ZStack {
Color(.backGround)
.ignoresSafeArea()

VStack(spacing: 30) {
// MARK: - 프로필 이미지
ZStack(alignment: .bottomTrailing) {
Button { viewModel.showPhotoSheet.toggle() } label: {
Circle()
.stroke(Color.appMain, lineWidth: 2)
.frame(width: 180, height: 180)
.background(
Image(systemName: "person.crop.circle.fill")
.resizable()
.scaledToFit()
.foregroundColor(.gray)
.frame(width: 180, height: 180)
)
}
Button { viewModel.showPhotoSheet.toggle() } label: {
Circle()
.fill(Color.black)
.frame(width: 45, height: 45)
.overlay(
Image(systemName: "camera")
.font(.system(size: 20, weight: .bold))
.foregroundColor(.white)
)
}
.offset(x: -5, y: -5)
}

// MARK: - 이름 입력란
VStack(alignment: .leading, spacing: 6) {
Text("이름")
.font(.pretendardBold16)
TextField("이름을 입력해주세요", text: $viewModel.name)
.font(.pretendardMedium16)
.padding(.horizontal, 20)
.frame(height: 54)
.background(
RoundedRectangle(cornerRadius: 20)
.stroke(Color.appMain, lineWidth: 2)
)
}

// MARK: - 성별 선택
VStack(alignment: .leading, spacing: 6) {
Text("성별")
.font(.pretendardBold16)
ZStack {
RoundedRectangle(cornerRadius: 20)
.stroke(Color.appMain, lineWidth: 2)
.frame(height: 54)

HStack {
Text(viewModel.gender.isEmpty ? "남성" : viewModel.gender)
.font(.pretendardMedium16)
.foregroundColor(viewModel.gender.isEmpty ? .black : .primary)
.padding(.leading, 20)

Spacer()

Menu {
Button { viewModel.selectGender("남성") } label: { Text("남성") }
Button { viewModel.selectGender("여성") } label: { Text("여성") }
} label: {
Image(systemName: "chevron.up.chevron.down")
.font(.pretendardBold16)
.foregroundColor(.gray)
.padding(.trailing, 12)
}
}
}
}

// MARK: - 키 수정
VStack(alignment: .leading, spacing: 6) {
Text("키")
.font(.pretendardBold16)
HStack(spacing: 0) {
TextField("170", text: $numberInput)
.keyboardType(.numberPad)
.multilineTextAlignment(.center)
.frame(height: 54)
.padding(.horizontal, 20)
.background(
RoundedRectangle(cornerRadius: 20)
.stroke(Color.appMain, lineWidth: 2)
)
.toolbar {
ToolbarItemGroup(placement: .keyboard) {
Spacer()
Button("완료") {
UIApplication.shared.sendAction(
#selector(UIResponder.resignFirstResponder),
to: nil, from: nil, for: nil
)
}
}
}
Text("cm")
.font(.custom("NerkoOne-regular", size: 50))
.foregroundColor(Color.appMain)
.padding(.leading, 12)
}
}

Spacer()
}
.padding(.top, 48)
.padding(.horizontal, 20)
.confirmationDialog(
"프로필 사진 선택",
isPresented: $viewModel.showPhotoSheet,
titleVisibility: .visible
) {
Button("카메라") { /* 카메라 액션 */ }
Button("갤러리") { /* 갤러리 액션 */ }
Button("취소", role: .cancel) {}
}
}

}
}
Loading