Skip to content

Commit

Permalink
#38 feat: ToDo Picker 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonGoon72 committed May 23, 2023
1 parent e00eda4 commit 056122d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
1 change: 0 additions & 1 deletion ToD/AfterChar/Board/BoardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import SwiftUI

struct BoardView: View {
var jobList : [String] = ["서버 / 백엔드", "프론트앤드", "모바일", "SW / 솔루션", "보안", "QA 엔지니어", "임베디드", "인공지능 / 머신러닝"]
var boardDataManager: BoardDataManager = BoardDataManager.shared
@State var job: JobItem = .all
@State var boardList: [BoardModel] = []
Expand Down
16 changes: 15 additions & 1 deletion ToD/AfterChar/ToDo/ToDoModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@

import Foundation

enum toDoItem: String, CaseIterable, Codable {
case dev
case normal
case tod

var displayToDoItemName: String {
switch self {
case .dev: return "개발"
case .normal: return "일반"
case .tod: return "투디 퀘스트"
}
}
}


struct ToDoModel: Codable {
var keyDate: Date

Expand All @@ -19,6 +34,5 @@ struct ToDoModel: Codable {
}

var deadLine: Date?

var todo: String
}
22 changes: 14 additions & 8 deletions ToD/AfterChar/ToDo/ToDoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import SwiftUI


struct ToDoView: View {
var dataManager: ToDoDataManager = ToDoDataManager.shared

@AppStorage("isChar") var isChar: Bool = true

@State private var showModal: Bool = false

@State var toDo: toDoItem = .tod

var body: some View {
NavigationView {
Expand All @@ -27,12 +28,17 @@ struct ToDoView: View {
Text("투디 이미지 미리보기")
}
Divider()
Picker(selection: /*@START_MENU_TOKEN@*/.constant(1)/*@END_MENU_TOKEN@*/, label: /*@START_MENU_TOKEN@*/Text("Picker")/*@END_MENU_TOKEN@*/) {
/*@START_MENU_TOKEN@*/Text("1").tag(1)/*@END_MENU_TOKEN@*/
/*@START_MENU_TOKEN@*/Text("2").tag(2)/*@END_MENU_TOKEN@*/
}.pickerStyle(.segmented)
.padding()

Picker("투디 퀘스트", selection: $toDo) {
ForEach(toDoItem.allCases, id: \.self) { todItem in
Text(todItem.displayToDoItemName)
.tag(todItem)
}
}
.onChange(of: toDo) { newValue in

}
.pickerStyle(.segmented)

Spacer()
VStack
{
Expand Down

0 comments on commit 056122d

Please sign in to comment.