diff --git a/iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift b/iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift index cc4f91c..995357b 100644 --- a/iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift +++ b/iOS-NOTTODO/Widget-NOTTODO/View/MediumFamily.swift @@ -10,14 +10,15 @@ import WidgetKit struct MediumFamily: View { var entry: Provider.Entry + @AppStorage("dayOfWeek", store: UserDefaults.shared) var dayOfWeek: String = "" var body: some View { let progressPercent = Double(entry.lastThreeTask.filter { $0.completionStatus == .CHECKED }.count) / Double(entry.lastThreeTask.count) HStack { VStack { ZStack { - Text("월") - .foregroundStyle(Color.black) + Text(dayOfWeek) + .foregroundStyle(dayOfWeek == "일" ? .wdgRed : .ntdBlack) .font(.custom("Pretendard", size: 18)) .fontWeight(.semibold) CircularProgressBarView(percent: progressPercent, size: 42, lineWidth: 4.34)} @@ -58,7 +59,7 @@ struct MediumFamily: View { .frame(width: 19, height: 19) Text(task.title) - .foregroundStyle(.gray1) + .foregroundStyle(task.completionStatus == .CHECKED ? .gray4 : .ntdBlack) .font(.custom("Pretendard-Regular", size: 11)) .fontWeight(.regular) Spacer() diff --git a/iOS-NOTTODO/iOS-NOTTODO/Presentation/Home/ViewControllers/HomeViewController.swift b/iOS-NOTTODO/iOS-NOTTODO/Presentation/Home/ViewControllers/HomeViewController.swift index 73e3304..84b2bb3 100644 --- a/iOS-NOTTODO/iOS-NOTTODO/Presentation/Home/ViewControllers/HomeViewController.swift +++ b/iOS-NOTTODO/iOS-NOTTODO/Presentation/Home/ViewControllers/HomeViewController.swift @@ -249,6 +249,7 @@ extension HomeViewController { if Utils.dateFormatterString(format: nil, date: today) == date { UserDefaults.shared?.setSharedCustomArray(data, forKey: "dailyMission") + UserDefaults.shared?.set(getDayOfWeek(date: today), forKey: "dayOfWeek") } } } @@ -322,6 +323,13 @@ extension HomeViewController { return sundayInWeek } + private func getDayOfWeek(date: Date) -> String { + let calendar = Calendar.current + let weekday = calendar.component(.weekday, from: date) + + return I18N.weekDay[weekday-1] + } + private func getPercentage(for date: Date) -> Float? { let dateString = Utils.dateFormatterString(format: nil, date: date)