Skip to content

Commit

Permalink
Merge pull request #49 from CNUBasicProjectLab/dev-#38
Browse files Browse the repository at this point in the history
Dev #38 - 최종완성
  • Loading branch information
MoonGoon72 authored May 29, 2023
2 parents 56cdc30 + dcf8222 commit 579d194
Show file tree
Hide file tree
Showing 29 changed files with 599 additions and 162 deletions.
4 changes: 4 additions & 0 deletions ToD.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand Down Expand Up @@ -57,6 +58,7 @@
BA7980622A18F884009DF732 /* CreateBoardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateBoardView.swift; sourceTree = "<group>"; };
BA969B2A2A07F6D200DBD597 /* CreateToDoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreateToDoView.swift; sourceTree = "<group>"; };
BAA1128C2A1DE8E400F7739C /* ToDoDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToDoDetailView.swift; sourceTree = "<group>"; };
BADE0EE92A2245FE000F9317 /* CharacterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterModel.swift; sourceTree = "<group>"; };
BAF6A61F2A15B4F0004F4E14 /* BoardDataManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardDataManager.swift; sourceTree = "<group>"; };
BAF6A6212A15B8B4004F4E14 /* BoardInputModal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardInputModal.swift; sourceTree = "<group>"; };
BAF6A6232A15BA83004F4E14 /* BoardModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -92,6 +94,7 @@
863E48EE29E4759B00488280 /* SelectAnswerView.swift */,
86DE110F29DFB52E00BA5643 /* WebContentView.swift */,
863E48F029E479C100488280 /* CreateCharacterView.swift */,
BADE0EE92A2245FE000F9317 /* CharacterModel.swift */,
);
path = BeforeChar;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down
58 changes: 51 additions & 7 deletions ToD/AfterChar/ToDo/ToDoDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion ToD/AfterChar/ToDo/ToDoModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ struct ToDoModel: Codable, Hashable {
var deadLine: Date?
var todo: String
var todoDetail: String
var isComplete: Bool
var isComplete: Bool = false
}
77 changes: 65 additions & 12 deletions ToD/AfterChar/ToDo/ToDoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,9 +30,10 @@ struct ToDoView: View {
.padding()
}
Button {
todoDataManager.toDoList = []
isChar = false
} label: {
Text("다시 false로")
Text("투디 다시 생성하기")
}

}
Expand Down Expand Up @@ -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()
}
}
}

Expand All @@ -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)
}
Expand All @@ -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 {
Expand All @@ -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)
}
Expand All @@ -126,6 +177,7 @@ struct ToDoListRow: View {
var updateTodo = todo
updateTodo.isComplete.toggle()
todoDataManager.updateToDoItem(updateTodo)
toDoList = todoDataManager.toDoList
}
}
}
Expand All @@ -138,5 +190,6 @@ struct ToDoListRow: View {
struct ToDoView_Previews: PreviewProvider {
static var previews: some View {
ToDoView()
// .previewLayout(.device)
}
}
6 changes: 6 additions & 0 deletions ToD/Assets.xcassets/characters/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
21 changes: 21 additions & 0 deletions ToD/Assets.xcassets/characters/ai_character.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 579d194

Please sign in to comment.