diff --git a/ToD.xcodeproj/project.pbxproj b/ToD.xcodeproj/project.pbxproj index 849a131..c5be624 100644 --- a/ToD.xcodeproj/project.pbxproj +++ b/ToD.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ BA7980632A18F884009DF732 /* CreateBoardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA7980622A18F884009DF732 /* CreateBoardView.swift */; }; BA969B2B2A07F6D200DBD597 /* CreateToDoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA969B2A2A07F6D200DBD597 /* CreateToDoView.swift */; }; BAA1128D2A1DE8E400F7739C /* ToDoDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAA1128C2A1DE8E400F7739C /* ToDoDetailView.swift */; }; + BADE0EEA2A2245FE000F9317 /* CharacterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BADE0EE92A2245FE000F9317 /* CharacterModel.swift */; }; BAF6A6202A15B4F0004F4E14 /* BoardDataManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAF6A61F2A15B4F0004F4E14 /* BoardDataManager.swift */; }; BAF6A6222A15B8B4004F4E14 /* BoardInputModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAF6A6212A15B8B4004F4E14 /* BoardInputModal.swift */; }; BAF6A6242A15BA83004F4E14 /* BoardModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAF6A6232A15BA83004F4E14 /* BoardModel.swift */; }; @@ -57,6 +58,7 @@ BA7980622A18F884009DF732 /* CreateBoardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateBoardView.swift; sourceTree = ""; }; BA969B2A2A07F6D200DBD597 /* CreateToDoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateToDoView.swift; sourceTree = ""; }; BAA1128C2A1DE8E400F7739C /* ToDoDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToDoDetailView.swift; sourceTree = ""; }; + BADE0EE92A2245FE000F9317 /* CharacterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterModel.swift; sourceTree = ""; }; BAF6A61F2A15B4F0004F4E14 /* BoardDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardDataManager.swift; sourceTree = ""; }; BAF6A6212A15B8B4004F4E14 /* BoardInputModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardInputModal.swift; sourceTree = ""; }; BAF6A6232A15BA83004F4E14 /* BoardModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardModel.swift; sourceTree = ""; }; @@ -92,6 +94,7 @@ 863E48EE29E4759B00488280 /* SelectAnswerView.swift */, 86DE110F29DFB52E00BA5643 /* WebContentView.swift */, 863E48F029E479C100488280 /* CreateCharacterView.swift */, + BADE0EE92A2245FE000F9317 /* CharacterModel.swift */, ); path = BeforeChar; sourceTree = ""; @@ -251,6 +254,7 @@ buildActionMask = 2147483647; files = ( BAF6A6202A15B4F0004F4E14 /* BoardDataManager.swift in Sources */, + BADE0EEA2A2245FE000F9317 /* CharacterModel.swift in Sources */, 862077F82A077507003A3E52 /* AfterCharTabControllerView.swift in Sources */, 861A4B7E29E06732002C740C /* MainView.swift in Sources */, 863E48EB29E46E9800488280 /* IntroView.swift in Sources */, diff --git a/ToD/AfterChar/ToDo/ToDoDataManager.swift b/ToD/AfterChar/ToDo/ToDoDataManager.swift index a947ba1..3c506b0 100644 --- a/ToD/AfterChar/ToDo/ToDoDataManager.swift +++ b/ToD/AfterChar/ToDo/ToDoDataManager.swift @@ -22,24 +22,68 @@ class ToDoDataManager: ObservableObject { } } - func getDummyDate() -> [ToDoModel] { + func getDummyData() -> [ToDoModel] { return [ - ToDoModel(keyDate: Date(), toDoType: .dev, todo: "깃허브 커밋하기", todoDetail: "알고리즘 문제풀고 커밋하기", isComplete: false), - ToDoModel(keyDate: Date(), toDoType: .dev, todo: "알고리즘 문제풀기", todoDetail: "골드 5 이상 문제 풀기", isComplete: false), - ToDoModel(keyDate: Date(), toDoType: .normal, todo: "일기 쓰기", todoDetail: "자기전에 쓰세용", isComplete: false), - ToDoModel(keyDate: Date(), toDoType: .tod, todo: "투디 퀘스트 no.1", todoDetail: "투디 퀘스트 디테일", isComplete: false) + ToDoModel(keyDate: Date(), toDoType: .dev, todo: "깃허브 커밋하기", todoDetail: "알고리즘 문제풀고 커밋하기"), + ToDoModel(keyDate: Date(), toDoType: .dev, todo: "알고리즘 문제풀기", todoDetail: "골드 5 이상 문제 풀기"), + ToDoModel(keyDate: Date(), toDoType: .normal, todo: "일기 쓰기", todoDetail: "자기전에 쓰세용"), + ToDoModel(keyDate: Date(), toDoType: .tod, todo: "투디 퀘스트 no.1", todoDetail: "투디 퀘스트 디테일") ] } - func getToDoList() -> [ToDoModel] { + func commonQuest() -> [ToDoModel] { + return [ + ToDoModel(keyDate: Date(), toDoType: .tod, todo: "백준 온라인 저지 문제 하루에 1개 해결하기", todoDetail: "백준 온라인 저지 문제 하루에 1개 해결하기 (하)"), + ToDoModel(keyDate: Date(), toDoType: .tod, todo: "개발 세미나 참여하기", todoDetail: "개발 세미나 참여하기 (중)"), + ToDoModel(keyDate: Date(), toDoType: .tod, todo: "깃허브 오픈소스 프로젝트 기여", todoDetail: "깃허브 오픈소스 프로젝트 기여 (상)") + ] + } + + func getToDoList(jobCategory myJob: String) -> [ToDoModel] { if toDoList.isEmpty { - return getDummyDate() +// return getDummyData() + self.toDoList = getTodData(jobCategory: myJob) + updateToDo() + return toDoList } let returnToDoList:[ToDoModel] = toDoList return returnToDoList } + func getTodData(jobCategory job: String) -> [ToDoModel] { + var todQuenst: [ToDoModel] = commonQuest() + switch job { + case characterCategory.server.displayJobName: + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "HTML, CSS, JavaScript를 활용하여 간단한 웹 페이지 개발하기", todoDetail: "HTML, CSS, JavaScript를 활용하여 간단한 웹 페이지 개발하기 (하)")) + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "자바와 데이터베이스를 연동하여 데이터베이스 프로그램 개발하기", todoDetail: "자바와 데이터베이스를 연동하여 데이터베이스 프로그램 개발하기 (상)")) + case characterCategory.frontEnd.displayJobName: + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "HTML과 CSS를 사용하여 간단한 정적 웹 페이지를 구성하기", todoDetail: "HTML과 CSS를 사용하여 간단한 정적 웹 페이지를 구성하기 (하)")) + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "선택한 프론트엔드 프레임워크를 사용하여 실제 프로젝트 개발하기", todoDetail: "선택한 프론트엔드 프레임워크를 사용하여 실제 프로젝트 개발하기 (상)")) + case characterCategory.moblie.displayJobName: + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "Figma에서 UI 디자인해보기", todoDetail: "Figma에서 UI 디자인해보기 (하)")) + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "파이어베이스 기능을 통해 푸쉬알림 구현해보기", todoDetail: "파이어베이스 기능을 통해 푸쉬알림 구현해보기 (상)")) + case characterCategory.sw.displayJobName: + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "UML을 이용한 설계 다이어그램 작성하기", todoDetail: "UML을 이용한 설계 다이어그램 작성하기")) + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "데이터베이스 연동 프로그램 작성하기", todoDetail: "데이터베이스 연동 프로그램 작성하기 (상)")) + case characterCategory.security.displayJobName: + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "대칭키와 공개키 암호화 기법, 해시 함수 학습하고 구현하기", todoDetail: "대칭키와 공개키 암호화 기법, 해시 함수 학습하고 구현하기 (하)")) + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "보안 개발 프레임워크를 활용하여 안전한 코드 개발하기", todoDetail: "보안 개발 프레임워크를 활용하여 안전한 코드 개발하기 (상)")) + case characterCategory.qa.displayJobName: + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "QA 역할과 소프트웨어 테스팅 기본 개념(테스팅 용어, 절차, 테스트 계획) 학습하기", todoDetail: "QA 역할과 소프트웨어 테스팅 기본 개념(테스팅 용어, 절차, 테스트 계획) 학습하기 (하)")) + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "버그 관리 도구 사용법 학습하기 (예: JIRA, Bugzilla)", todoDetail: "버그 관리 도구 사용법 학습하기 (예: JIRA, Bugzilla) (상)")) + case characterCategory.embeded.displayJobName: + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "선택한 실시간 운영체제 관련 코드와 튜토리얼 하루에 1개 학습하기", todoDetail: "선택한 실시간 운영체제 관련 코드와 튜토리얼 하루에 1개 학습하기 (하)")) + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "실제 프로젝트에 실시간 운영체제를 적용해보기", todoDetail: "실제 프로젝트에 실시간 운영체제를 적용해보기 (상)")) + case characterCategory.ai.displayJobName: + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "Scikit-learn, TensorFlow, PyTorch 등의 머신러닝 라이브러리 학습하기", todoDetail: "Scikit-learn, TensorFlow, PyTorch 등의 머신러닝 라이브러리 학습하기 (하)")) + todQuenst.append(ToDoModel(keyDate: Date(), toDoType: .tod, todo: "실제 데이터셋을 활용하여 머신러닝 및 딥러닝 프로젝트 수행하기", todoDetail: "실제 데이터셋을 활용하여 머신러닝 및 딥러닝 프로젝트 수행하기 (상)")) + default: + break + } + return todQuenst + } + func add(ToDoModel acData:ToDoModel?) -> Bool { if let data = acData { toDoList.insert(data, at: 0) diff --git a/ToD/AfterChar/ToDo/ToDoModel.swift b/ToD/AfterChar/ToDo/ToDoModel.swift index 6964233..5fa2b95 100644 --- a/ToD/AfterChar/ToDo/ToDoModel.swift +++ b/ToD/AfterChar/ToDo/ToDoModel.swift @@ -41,5 +41,5 @@ struct ToDoModel: Codable, Hashable { var deadLine: Date? var todo: String var todoDetail: String - var isComplete: Bool + var isComplete: Bool = false } diff --git a/ToD/AfterChar/ToDo/ToDoView.swift b/ToD/AfterChar/ToDo/ToDoView.swift index c02d6a6..74b0750 100644 --- a/ToD/AfterChar/ToDo/ToDoView.swift +++ b/ToD/AfterChar/ToDo/ToDoView.swift @@ -9,17 +9,19 @@ import SwiftUI struct ToDoView: View { - var todoDataManager: ToDoDataManager = ToDoDataManager.shared + @AppStorage("myJobCategory") var myJob: String! + @ObservedObject var todoDataManager: ToDoDataManager = ToDoDataManager.shared @AppStorage("isChar") var isChar: Bool = true @State private var showModal: Bool = false @State var todoCategory: Category = .dev @Environment(\.refresh) private var refresh + var body: some View { NavigationStack { VStack { ScrollView{ - VStack(alignment: .leading) { + VStack(alignment: .center) { toDCharacter Divider() toDPicker @@ -28,9 +30,10 @@ struct ToDoView: View { .padding() } Button { + todoDataManager.toDoList = [] isChar = false } label: { - Text("다시 false로") + Text("투디 다시 생성하기") } } @@ -62,12 +65,55 @@ struct ToDoView: View { } var toDCharacter: some View { - ZStack{ - RoundedRectangle(cornerRadius: 15) - .frame(height: 280) - .foregroundColor(Color.secondary) - .shadow(color: .gray, radius: 2, x: 0, y: 3) - Text("투디 이미지 미리보기") + VStack { + switch myJob { + case characterCategory.frontEnd.displayJobName: + Image("frontend_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.server.displayJobName: + Image("backend_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.moblie.displayJobName: + Image("moblie_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.sw.displayJobName: + Image("sw_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.security.displayJobName: + Image("security_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.qa.displayJobName: + Image("qa_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.embeded.displayJobName: + Image("embeded_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.ai.displayJobName: + Image("ai_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + + default: + Image("default_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + } } } @@ -87,7 +133,7 @@ struct ToDoView: View { var toDQuest: some View { VStack(alignment: .leading) { - ForEach(Array(todoDataManager.getToDoList().enumerated()), id: \.offset) { idx, data in + ForEach(Array(todoDataManager.getToDoList(jobCategory: myJob).enumerated()), id: \.offset) { idx, data in if (data.toDoType == todoCategory) && (data.isComplete == false) { ToDoListRow(todo: data) } @@ -100,7 +146,8 @@ struct ToDoView: View { struct ToDoListRow: View { @State var todo: ToDoModel - var todoDataManager: ToDoDataManager = ToDoDataManager.shared + @State var toDoList: [ToDoModel] = [] + @ObservedObject var todoDataManager: ToDoDataManager = ToDoDataManager.shared var body: some View { NavigationLink { @@ -110,10 +157,14 @@ struct ToDoListRow: View { HStack { VStack(alignment: .leading) { Text(todo.todo) + .multilineTextAlignment(.leading) .foregroundColor(.black) - .font(.title2) + .font(.title3) + + Text(todo.todoDetail) + .multilineTextAlignment(.leading) .lineLimit(1) .foregroundColor(.gray) } @@ -126,6 +177,7 @@ struct ToDoListRow: View { var updateTodo = todo updateTodo.isComplete.toggle() todoDataManager.updateToDoItem(updateTodo) + toDoList = todoDataManager.toDoList } } } @@ -138,5 +190,6 @@ struct ToDoListRow: View { struct ToDoView_Previews: PreviewProvider { static var previews: some View { ToDoView() +// .previewLayout(.device) } } diff --git a/ToD/Assets.xcassets/characters/Contents.json b/ToD/Assets.xcassets/characters/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ToD/Assets.xcassets/characters/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/ai_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/ai_character.imageset/Contents.json new file mode 100644 index 0000000..107cb42 --- /dev/null +++ b/ToD/Assets.xcassets/characters/ai_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "ai.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/ai_character.imageset/ai.png b/ToD/Assets.xcassets/characters/ai_character.imageset/ai.png new file mode 100644 index 0000000..1c25c3e Binary files /dev/null and b/ToD/Assets.xcassets/characters/ai_character.imageset/ai.png differ diff --git a/ToD/Assets.xcassets/characters/backend_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/backend_character.imageset/Contents.json new file mode 100644 index 0000000..c092e08 --- /dev/null +++ b/ToD/Assets.xcassets/characters/backend_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "backend.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/backend_character.imageset/backend.png b/ToD/Assets.xcassets/characters/backend_character.imageset/backend.png new file mode 100644 index 0000000..bc4d3a9 Binary files /dev/null and b/ToD/Assets.xcassets/characters/backend_character.imageset/backend.png differ diff --git a/ToD/Assets.xcassets/characters/default_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/default_character.imageset/Contents.json new file mode 100644 index 0000000..7f2fe48 --- /dev/null +++ b/ToD/Assets.xcassets/characters/default_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "defualt.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/default_character.imageset/defualt.png b/ToD/Assets.xcassets/characters/default_character.imageset/defualt.png new file mode 100644 index 0000000..f60b712 Binary files /dev/null and b/ToD/Assets.xcassets/characters/default_character.imageset/defualt.png differ diff --git a/ToD/Assets.xcassets/characters/embeded_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/embeded_character.imageset/Contents.json new file mode 100644 index 0000000..704f6b7 --- /dev/null +++ b/ToD/Assets.xcassets/characters/embeded_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "embeded.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/embeded_character.imageset/embeded.png b/ToD/Assets.xcassets/characters/embeded_character.imageset/embeded.png new file mode 100644 index 0000000..dc22e54 Binary files /dev/null and b/ToD/Assets.xcassets/characters/embeded_character.imageset/embeded.png differ diff --git a/ToD/Assets.xcassets/characters/frontend_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/frontend_character.imageset/Contents.json new file mode 100644 index 0000000..d4ea481 --- /dev/null +++ b/ToD/Assets.xcassets/characters/frontend_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "frontend.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/frontend_character.imageset/frontend.png b/ToD/Assets.xcassets/characters/frontend_character.imageset/frontend.png new file mode 100644 index 0000000..064da1d Binary files /dev/null and b/ToD/Assets.xcassets/characters/frontend_character.imageset/frontend.png differ diff --git a/ToD/Assets.xcassets/characters/intermediate_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/intermediate_character.imageset/Contents.json new file mode 100644 index 0000000..c0c6401 --- /dev/null +++ b/ToD/Assets.xcassets/characters/intermediate_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "intermediate.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/intermediate_character.imageset/intermediate.png b/ToD/Assets.xcassets/characters/intermediate_character.imageset/intermediate.png new file mode 100644 index 0000000..34d8a8f Binary files /dev/null and b/ToD/Assets.xcassets/characters/intermediate_character.imageset/intermediate.png differ diff --git a/ToD/Assets.xcassets/characters/moblie_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/moblie_character.imageset/Contents.json new file mode 100644 index 0000000..cfff839 --- /dev/null +++ b/ToD/Assets.xcassets/characters/moblie_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "moblie.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/moblie_character.imageset/moblie.png b/ToD/Assets.xcassets/characters/moblie_character.imageset/moblie.png new file mode 100644 index 0000000..c87b1b4 Binary files /dev/null and b/ToD/Assets.xcassets/characters/moblie_character.imageset/moblie.png differ diff --git a/ToD/Assets.xcassets/characters/qa_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/qa_character.imageset/Contents.json new file mode 100644 index 0000000..37e11e5 --- /dev/null +++ b/ToD/Assets.xcassets/characters/qa_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "qa.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/qa_character.imageset/qa.png b/ToD/Assets.xcassets/characters/qa_character.imageset/qa.png new file mode 100644 index 0000000..ed4126c Binary files /dev/null and b/ToD/Assets.xcassets/characters/qa_character.imageset/qa.png differ diff --git a/ToD/Assets.xcassets/characters/security_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/security_character.imageset/Contents.json new file mode 100644 index 0000000..4cafc4b --- /dev/null +++ b/ToD/Assets.xcassets/characters/security_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "security.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/security_character.imageset/security.png b/ToD/Assets.xcassets/characters/security_character.imageset/security.png new file mode 100644 index 0000000..2958b46 Binary files /dev/null and b/ToD/Assets.xcassets/characters/security_character.imageset/security.png differ diff --git a/ToD/Assets.xcassets/characters/sw_character.imageset/Contents.json b/ToD/Assets.xcassets/characters/sw_character.imageset/Contents.json new file mode 100644 index 0000000..cb26f49 --- /dev/null +++ b/ToD/Assets.xcassets/characters/sw_character.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "sw.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ToD/Assets.xcassets/characters/sw_character.imageset/sw.png b/ToD/Assets.xcassets/characters/sw_character.imageset/sw.png new file mode 100644 index 0000000..7128edb Binary files /dev/null and b/ToD/Assets.xcassets/characters/sw_character.imageset/sw.png differ diff --git a/ToD/BeforeChar/CharacterModel.swift b/ToD/BeforeChar/CharacterModel.swift new file mode 100644 index 0000000..7c0f4cd --- /dev/null +++ b/ToD/BeforeChar/CharacterModel.swift @@ -0,0 +1,48 @@ +// +// CharacterModel.swift +// ToD +// +// Created by 문영균 on 2023/05/27. +// + +import Foundation + +enum characterCategory: String, CaseIterable, Codable { + case none + case server + case frontEnd + case moblie + case sw + case security + case qa + case embeded + case ai + + var displayJobImageName: String { + switch self { + case .server: return "back" + case .frontEnd: return "front" + case .moblie: return "mobile" + case .sw: return "swsolution" + case .security: return "security" + case .qa: return "bug" + case .embeded: return "embedded" + case .ai: return "ai" + default: return "not selected" + } + } + + var displayJobName: String { + switch self { + case .server: return "서버/백엔드" + case .frontEnd: return "프론트엔드" + case .moblie: return "모바일" + case .sw: return "SW/솔루션" + case .security: return "보안" + case .qa: return "QA엔지니어" + case .embeded: return "임베디드" + case .ai: return "인공지능/머신러닝" + default: return "not selected" + } + } +} diff --git a/ToD/BeforeChar/CreateCharacterView.swift b/ToD/BeforeChar/CreateCharacterView.swift index 462d8ba..479c3ca 100644 --- a/ToD/BeforeChar/CreateCharacterView.swift +++ b/ToD/BeforeChar/CreateCharacterView.swift @@ -9,147 +9,219 @@ import SwiftUI struct CreateCharacterView: View { @AppStorage("isChar") var isChar: Bool = false + @AppStorage("myJobCategory") var myJob: String = "" @State var index: Int = -1 var body: some View { - - VStack{ - Spacer() - VStack(){ - Text("어떤 직종을 희망하시나요?") - .font(.system(size : 20, weight: .semibold)) - } - .frame(maxWidth: .infinity , alignment: .leading) - .padding() - // 상단 아이콘 - HStack(alignment: .center, spacing: 10){ - VStack{ - Image("back") - .resizable() - .frame(width: index != 0 ? 50 : 70,height: index != 0 ? 50 : 70) - Text("서버/\n백엔드") - } - .frame(width: 80) - .onTapGesture { - index = 0 - } - .animation(.easeIn, value: index) - VStack{ - Image("front") - .resizable() - .frame(width: index != 1 ? 50 : 70,height: index != 1 ? 50 : 70) - Text("프론트엔드") - } - .frame(width: 80) - .onTapGesture { - index = 1 - } - .animation(.easeIn, value: index) - VStack{ - - Image("mobile") - .resizable() - .frame(width: index != 2 ? 50 : 70,height: index != 2 ? 50 : 70) - - Text("모바일\n") - } - .frame(width: 80) - .onTapGesture { - index = 2 - } - .animation(.easeIn, value: index) - VStack{ - Image("swsolution") - .resizable() - .frame(width: index != 3 ? 50 : 70,height: index != 3 ? 50 : 70) - - Text("SW/\n솔루션") - } - .frame(width: 80) - .onTapGesture { - index = 3 - } - .animation(.easeIn, value: index) - } - .padding(.bottom) - // 하단 아이콘 - HStack(spacing: 10){ - VStack{ - Image("security") - .resizable() - .frame(width: index != 4 ? 50 : 70,height: index != 4 ? 50 : 70) - - Text("보안\n") - } - .frame(width: 80) - .onTapGesture { - index = 4 - } - .animation(.easeIn, value: index) - VStack{ - Image("bug") - .resizable() - .frame(width: index != 5 ? 50 : 70,height: index != 5 ? 50 : 70) - - Text("QA엔지니어") - } - .frame(width: 80) - .onTapGesture { - index = 5 - } - .animation(.easeIn, value: index) - VStack{ - Image("embedded") - .resizable() - .frame(width: index != 6 ? 50 : 70,height: index != 6 ? 50 : 70) - - Text("임베디드\n") - } - .frame(width: 80) - .onTapGesture { - index = 6 - } - .animation(.easeIn, value: index) - VStack{ - Image("ai") - .resizable() - .frame(width: index != 7 ? 50 : 70,height: index != 7 ? 50 : 70) - - Text("인공지능/\n머신러닝") - } - .frame(width: 80) - .onTapGesture { - index = 7 - } - .animation(.easeIn, value: index) - } -// .padding() - - RoundedRectangle(cornerRadius: 15 , style: .continuous) - .fill(Color.gray) + ScrollView { + VStack{ + // Spacer() + VStack(){ + HStack { + Text("어떤 직종을 희망하시나요?") + .font(.system(size : 20, weight: .semibold)) + } + } + .frame(maxWidth: .infinity , alignment: .leading) .padding() - .overlay(Text("투디 미리보기") - .foregroundColor(Color.white)) - VStack(alignment :.leading){ - Text("⚠️ 주의") - .font(.system(size : 20, weight: .semibold)) - .padding() - Text("한 번 생성한 투디 개발자를 를 변경하는 경우, 투디의 성장은 초기화 됩니다. 다만, 여러분이 실제로 경험하고 성장하는 것과 무관합니다. 이에 주의해주시기 바랍니다.") - .font(.system(size : 15)) - .padding(.horizontal) + VStack { + // 상단 아이콘 + HStack(alignment: .center, spacing: 10) { + VStack{ + Image("back") + .resizable() + .frame(width: index != 0 ? 50 : 60,height: index != 0 ? 50 : 60) + Text("서버/백엔드") + .minimumScaleFactor(0.5) + } + .frame(width: 80) + .onTapGesture { + index = 0 + myJob = characterCategory.server.displayJobName + } + .animation(.easeIn, value: index) + VStack{ + Image("front") + .resizable() + .frame(width: index != 1 ? 50 : 60,height: index != 1 ? 50 : 60) + Text("프론트엔드") + .minimumScaleFactor(0.5) + } + .frame(width: 80) + .onTapGesture { + index = 1 + myJob = characterCategory.frontEnd.displayJobName + } + .animation(.easeIn, value: index) + VStack{ + + Image("mobile") + .resizable() + .frame(width: index != 2 ? 50 : 60,height: index != 2 ? 50 : 60) + + Text("모바일") + .minimumScaleFactor(0.5) + } + .frame(width: 80) + .onTapGesture { + index = 2 + myJob = characterCategory.moblie.displayJobName + } + .animation(.easeIn, value: index) + VStack{ + Image("swsolution") + .resizable() + .frame(width: index != 3 ? 50 : 60,height: index != 3 ? 50 : 60) + + Text("SW/솔루션") + .minimumScaleFactor(0.5) + } + .frame(width: 80) + .onTapGesture { + index = 3 + myJob = characterCategory.sw.displayJobName + } + .animation(.easeIn, value: index) + } + + // 하단 아이콘 + HStack(spacing: 10) { + VStack{ + Image("security") + .resizable() + .frame(width: index != 4 ? 50 : 60,height: index != 4 ? 50 : 60) + + Text("보안") + .minimumScaleFactor(0.5) + } + .frame(width: 80) + .onTapGesture { + index = 4 + myJob = characterCategory.security.displayJobName + } + .animation(.easeIn, value: index) + VStack{ + Image("bug") + .resizable() + .frame(width: index != 5 ? 50 : 60,height: index != 5 ? 50 : 60) + + Text("QA엔지니어") + .minimumScaleFactor(0.5) + } + .frame(width: 80) + .onTapGesture { + index = 5 + myJob = characterCategory.qa.displayJobName + } + .animation(.easeIn, value: index) + VStack{ + Image("embedded") + .resizable() + .frame(width: index != 6 ? 50 : 60,height: index != 6 ? 50 : 60) + + Text("임베디드") + .minimumScaleFactor(0.5) + } + .frame(width: 80) + .onTapGesture { + index = 6 + myJob = characterCategory.embeded.displayJobName + } + .animation(.easeIn, value: index) + VStack{ + Image("ai") + .resizable() + .frame(width: index != 7 ? 50 : 60,height: index != 7 ? 50 : 60) + + Text("인공지능/머신러닝") + .minimumScaleFactor(0.5) + } + .frame(width: 80) + .onTapGesture { + index = 7 + myJob = characterCategory.ai.displayJobName + } + .animation(.easeIn, value: index) + } + } + .frame(height: 230) + VStack { + switch myJob { + case characterCategory.frontEnd.displayJobName: + Image("frontend_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.server.displayJobName: + Image("backend_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.moblie.displayJobName: + Image("moblie_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.sw.displayJobName: + Image("sw_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.security.displayJobName: + Image("security_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.qa.displayJobName: + Image("qa_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.embeded.displayJobName: + Image("embeded_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + case characterCategory.ai.displayJobName: + Image("ai_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + + default: + Image("default_character") + .resizable() + .frame(width: 200, height: 200) + .padding() + } + } + // RoundedRectangle(cornerRadius: 15 , style: .continuous) + // .fill(Color.gray) + // .padding() + // .overlay(Text("투디 미리보기") + // .foregroundColor(Color.white)) + VStack(alignment :.leading){ + Text("⚠️ 주의") + .font(.system(size : 20, weight: .semibold)) + .padding() + Text("한 번 생성한 투디 개발자를 를 변경하는 경우, 투디의 성장은 초기화 됩니다. 다만, 여러분이 실제로 경험하고 성장하는 것과 무관합니다. 이에 주의해주시기 바랍니다.") + .font(.system(size : 15)) + .padding(.horizontal) + + } + Button { + isChar = true + } label: { + Text("ToD 캐릭터 생성하기") + .font(.headline) + .frame(maxWidth: 200) + .foregroundColor(.white) + .padding() + }.background(.blue) + .cornerRadius(15) + .shadow(color: .gray, radius: 2, x: 0, y: 3) + .padding(.vertical) } - Button { - isChar = true - } label: { - Text("생성하기") - .font(.headline) - .frame(maxWidth: 200) - .foregroundColor(.white) - .padding() - }.background(.blue) - .cornerRadius(15) - .shadow(color: .gray, radius: 2, x: 0, y: 3) - .padding(.vertical) } } } diff --git a/ToD/BeforeChar/SelectAnswerView.swift b/ToD/BeforeChar/SelectAnswerView.swift index 9b73342..6925c45 100644 --- a/ToD/BeforeChar/SelectAnswerView.swift +++ b/ToD/BeforeChar/SelectAnswerView.swift @@ -18,10 +18,10 @@ struct SelectAnswerView: View { LottieView(filename: "thinking") .frame(width: 200, height: 250) - Text("희망하는 개발자가 있나요?") + Text("희망하는 분야가 있나요?") .font(.system(size : 20, weight: .semibold)) .padding(.bottom) - Text("원하는 개발자가 생각이 안난다면 투디가 도와드릴게요") + Text("원하는 분야가 생각이 안난다면 투디가 도와드릴게요") // .frame(width: 260) .foregroundColor(.gray) .font(.system(size : 15, weight: .semibold)) @@ -38,7 +38,7 @@ struct SelectAnswerView: View { // .navigationBarBackButtonHidden(true) }label:{ VStack{ - Text("생성하기") + Text("시작하기") .font(.headline) .frame(maxWidth: .infinity) .foregroundColor(.blue) @@ -55,7 +55,7 @@ struct SelectAnswerView: View { // .navigationBarBackButtonHidden(true) }label:{ - Text("도움 받기") + Text("도움받기") .font(.headline) .frame(maxWidth: .infinity) .foregroundColor(.white) diff --git a/ToD/MainView.swift b/ToD/MainView.swift index 4343105..4a59e13 100644 --- a/ToD/MainView.swift +++ b/ToD/MainView.swift @@ -16,10 +16,10 @@ struct MainView: View { var body: some View { NavigationView{ - if isChar{ + if isChar { AfterCharTabControllerView() - }else{ + } else { IntroView() } }