Skip to content

Commit

Permalink
enhancement: ObservedObject 사용하여 DataManager의 값이 변화를 감지하여 새로 뿌려주도록 하였음
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonGoon72 committed May 29, 2023
1 parent 8bee8f9 commit dcf8222
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ToD/AfterChar/ToDo/ToDoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import SwiftUI

struct ToDoView: View {
@AppStorage("myJobCategory") var myJob: String!
var todoDataManager: ToDoDataManager = ToDoDataManager.shared
@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 {
Expand Down Expand Up @@ -146,7 +147,7 @@ struct ToDoView: View {
struct ToDoListRow: View {
@State var todo: ToDoModel
@State var toDoList: [ToDoModel] = []
var todoDataManager: ToDoDataManager = ToDoDataManager.shared
@ObservedObject var todoDataManager: ToDoDataManager = ToDoDataManager.shared

var body: some View {
NavigationLink {
Expand Down

0 comments on commit dcf8222

Please sign in to comment.