From 648e4beeaa477ad9353f13812f95ae2c160212fe Mon Sep 17 00:00:00 2001 From: opficdev Date: Tue, 31 Mar 2026 00:48:03 +0900 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=EB=B6=88=ED=95=84=EC=9A=94=ED=95=9C?= =?UTF-8?q?=20=3D=3D=20=EC=97=B0=EC=82=B0=EC=9E=90=20=EA=B5=AC=ED=98=84?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EC=9D=B8=ED=95=B4=20=EC=88=98=EC=A0=95?= =?UTF-8?q?=EB=90=98=EC=97=88=EC=9D=84=20=EC=8B=9C=20=EB=B7=B0=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EB=B0=98=EC=98=81=EC=9D=B4=20=EC=95=88=EB=90=98?= =?UTF-8?q?=EB=8A=94=20=ED=98=84=EC=83=81=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DevLog/Domain/Entity/WebPage.swift | 2 +- .../Structure/Profile/ProfileSelectedDayActivity.swift | 6 ------ DevLog/Presentation/Structure/PushNotificationItem.swift | 4 ---- DevLog/Presentation/Structure/RecentTodoItem.swift | 4 ---- DevLog/Presentation/Structure/TodayTodoItem.swift | 4 ---- DevLog/Presentation/Structure/WebPageItem.swift | 6 ------ 6 files changed, 1 insertion(+), 25 deletions(-) diff --git a/DevLog/Domain/Entity/WebPage.swift b/DevLog/Domain/Entity/WebPage.swift index fb1b5305..ff6acd79 100644 --- a/DevLog/Domain/Entity/WebPage.swift +++ b/DevLog/Domain/Entity/WebPage.swift @@ -7,7 +7,7 @@ import Foundation -struct WebPage { +struct WebPage: Equatable { let title: String? let url: URL let displayURL: URL diff --git a/DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift b/DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift index 9ad52abf..94527917 100644 --- a/DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift +++ b/DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift @@ -21,12 +21,6 @@ struct ProfileSelectedDayActivity: Identifiable, Hashable { return showsCreated ? "생성" : "완료" } - static func == (lhs: Self, rhs: Self) -> Bool { - lhs.todo.id == rhs.todo.id - && lhs.showsCreated == rhs.showsCreated - && lhs.showsCompleted == rhs.showsCompleted - } - func hash(into hasher: inout Hasher) { hasher.combine(todo.id) hasher.combine(showsCreated) diff --git a/DevLog/Presentation/Structure/PushNotificationItem.swift b/DevLog/Presentation/Structure/PushNotificationItem.swift index cce0d540..582e29a3 100644 --- a/DevLog/Presentation/Structure/PushNotificationItem.swift +++ b/DevLog/Presentation/Structure/PushNotificationItem.swift @@ -26,10 +26,6 @@ struct PushNotificationItem: Identifiable, Hashable { self.todoCategory = notification.todoCategory } - static func == (lhs: PushNotificationItem, rhs: PushNotificationItem) -> Bool { - lhs.id == rhs.id - } - func hash(into hasher: inout Hasher) { hasher.combine(id) } diff --git a/DevLog/Presentation/Structure/RecentTodoItem.swift b/DevLog/Presentation/Structure/RecentTodoItem.swift index 0d972555..8a5d1633 100644 --- a/DevLog/Presentation/Structure/RecentTodoItem.swift +++ b/DevLog/Presentation/Structure/RecentTodoItem.swift @@ -26,10 +26,6 @@ struct RecentTodoItem: Identifiable, Hashable { self.category = todo.category } - static func == (lhs: RecentTodoItem, rhs: RecentTodoItem) -> Bool { - lhs.id == rhs.id - } - func hash(into hasher: inout Hasher) { hasher.combine(id) } diff --git a/DevLog/Presentation/Structure/TodayTodoItem.swift b/DevLog/Presentation/Structure/TodayTodoItem.swift index 7e583bbc..9c822f0e 100644 --- a/DevLog/Presentation/Structure/TodayTodoItem.swift +++ b/DevLog/Presentation/Structure/TodayTodoItem.swift @@ -28,10 +28,6 @@ struct TodayTodoItem: Identifiable, Hashable { self.category = todo.category } - static func == (lhs: TodayTodoItem, rhs: TodayTodoItem) -> Bool { - lhs.id == rhs.id - } - func hash(into hasher: inout Hasher) { hasher.combine(id) } diff --git a/DevLog/Presentation/Structure/WebPageItem.swift b/DevLog/Presentation/Structure/WebPageItem.swift index 2133a7bb..e2f23660 100644 --- a/DevLog/Presentation/Structure/WebPageItem.swift +++ b/DevLog/Presentation/Structure/WebPageItem.swift @@ -19,14 +19,8 @@ struct WebPageItem: Identifiable, Hashable { var url: URL { metadata.url } var displayURL: String { metadata.displayURL.absoluteString } var imageURL: URL? { metadata.imageURL } -} -extension WebPageItem { func hash(into hasher: inout Hasher) { hasher.combine(metadata.url) } - - static func == (lhs: WebPageItem, rhs: WebPageItem) -> Bool { - lhs.metadata.url == rhs.metadata.url - } } From 6c795c9323a87f7c23e552c4fd344854ca0caf2d Mon Sep 17 00:00:00 2001 From: opficdev Date: Tue, 31 Mar 2026 00:59:06 +0900 Subject: [PATCH 2/4] =?UTF-8?q?refacto:=20=EC=97=94=ED=8B=B0=ED=8B=B0=20?= =?UTF-8?q?=EB=AA=A8=EB=8D=B8=EC=97=90=20Hashable=EC=9D=84=20=EC=9D=BC?= =?UTF-8?q?=EA=B4=84=20=EC=A0=81=EC=9A=A9=ED=95=98=EC=97=AC=20=ED=94=84?= =?UTF-8?q?=EB=A0=88=EC=A0=A0=ED=85=8C=EC=9D=B4=EC=85=98=20=EB=AA=A8?= =?UTF-8?q?=EB=8D=B8=EC=97=90=EC=84=9C=20=EA=B5=AC=ED=98=84=EC=9D=84=20?= =?UTF-8?q?=EC=B5=9C=EC=86=8C=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DevLog/Domain/Entity/PushNotification.swift | 2 +- DevLog/Domain/Entity/SystemTodoCategory.swift | 2 +- DevLog/Domain/Entity/Todo.swift | 2 +- DevLog/Domain/Entity/TodoCategory.swift | 2 +- DevLog/Domain/Entity/TodoReference.swift | 2 +- DevLog/Domain/Entity/UserTodoCategory.swift | 2 +- DevLog/Domain/Entity/WebPage.swift | 2 +- .../Structure/Profile/ProfileSelectedDayActivity.swift | 6 ------ DevLog/Presentation/Structure/PushNotificationItem.swift | 4 ---- DevLog/Presentation/Structure/RecentTodoItem.swift | 4 ---- DevLog/Presentation/Structure/TodayTodoItem.swift | 4 ---- DevLog/Presentation/Structure/UserTodoCategoryItem.swift | 8 -------- DevLog/Presentation/Structure/WebPageItem.swift | 4 ---- 13 files changed, 7 insertions(+), 37 deletions(-) diff --git a/DevLog/Domain/Entity/PushNotification.swift b/DevLog/Domain/Entity/PushNotification.swift index 06b29eeb..6d2a00bc 100644 --- a/DevLog/Domain/Entity/PushNotification.swift +++ b/DevLog/Domain/Entity/PushNotification.swift @@ -7,7 +7,7 @@ import Foundation -struct PushNotification { +struct PushNotification: Hashable { let id: String let title: String let body: String diff --git a/DevLog/Domain/Entity/SystemTodoCategory.swift b/DevLog/Domain/Entity/SystemTodoCategory.swift index e49fdd52..32020626 100644 --- a/DevLog/Domain/Entity/SystemTodoCategory.swift +++ b/DevLog/Domain/Entity/SystemTodoCategory.swift @@ -7,7 +7,7 @@ import Foundation -enum SystemTodoCategory: String, CaseIterable { +enum SystemTodoCategory: String, CaseIterable, Hashable { case issue // 이슈 case feature // 신규 기능 case improvement // 개선/리팩터링 diff --git a/DevLog/Domain/Entity/Todo.swift b/DevLog/Domain/Entity/Todo.swift index e34da02c..da3c69e9 100644 --- a/DevLog/Domain/Entity/Todo.swift +++ b/DevLog/Domain/Entity/Todo.swift @@ -7,7 +7,7 @@ import Foundation -struct Todo: Equatable { +struct Todo: Hashable { let id: String var isPinned: Bool // 해당 할 일이 상단에 고정되어 있는지 여부 var isCompleted: Bool // 해당 할 일의 완료 여부 diff --git a/DevLog/Domain/Entity/TodoCategory.swift b/DevLog/Domain/Entity/TodoCategory.swift index a914869a..85e177db 100644 --- a/DevLog/Domain/Entity/TodoCategory.swift +++ b/DevLog/Domain/Entity/TodoCategory.swift @@ -7,7 +7,7 @@ import Foundation -enum TodoCategory: Equatable { +enum TodoCategory: Hashable { case system(SystemTodoCategory) case user(UserTodoCategory) diff --git a/DevLog/Domain/Entity/TodoReference.swift b/DevLog/Domain/Entity/TodoReference.swift index 3b8a7470..5a7ccf23 100644 --- a/DevLog/Domain/Entity/TodoReference.swift +++ b/DevLog/Domain/Entity/TodoReference.swift @@ -7,7 +7,7 @@ import Foundation -struct TodoReference { +struct TodoReference: Hashable { let id: String let title: String let category: TodoCategory diff --git a/DevLog/Domain/Entity/UserTodoCategory.swift b/DevLog/Domain/Entity/UserTodoCategory.swift index f35ff6e0..9b05b766 100644 --- a/DevLog/Domain/Entity/UserTodoCategory.swift +++ b/DevLog/Domain/Entity/UserTodoCategory.swift @@ -7,7 +7,7 @@ import Foundation -struct UserTodoCategory: Equatable { +struct UserTodoCategory: Hashable { var id: String var name: String var colorHex: String diff --git a/DevLog/Domain/Entity/WebPage.swift b/DevLog/Domain/Entity/WebPage.swift index ff6acd79..5a16ad80 100644 --- a/DevLog/Domain/Entity/WebPage.swift +++ b/DevLog/Domain/Entity/WebPage.swift @@ -7,7 +7,7 @@ import Foundation -struct WebPage: Equatable { +struct WebPage: Hashable { let title: String? let url: URL let displayURL: URL diff --git a/DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift b/DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift index 94527917..fb56c40e 100644 --- a/DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift +++ b/DevLog/Presentation/Structure/Profile/ProfileSelectedDayActivity.swift @@ -20,10 +20,4 @@ struct ProfileSelectedDayActivity: Identifiable, Hashable { } return showsCreated ? "생성" : "완료" } - - func hash(into hasher: inout Hasher) { - hasher.combine(todo.id) - hasher.combine(showsCreated) - hasher.combine(showsCompleted) - } } diff --git a/DevLog/Presentation/Structure/PushNotificationItem.swift b/DevLog/Presentation/Structure/PushNotificationItem.swift index 582e29a3..dd8273fb 100644 --- a/DevLog/Presentation/Structure/PushNotificationItem.swift +++ b/DevLog/Presentation/Structure/PushNotificationItem.swift @@ -25,8 +25,4 @@ struct PushNotificationItem: Identifiable, Hashable { self.todoId = notification.todoId self.todoCategory = notification.todoCategory } - - func hash(into hasher: inout Hasher) { - hasher.combine(id) - } } diff --git a/DevLog/Presentation/Structure/RecentTodoItem.swift b/DevLog/Presentation/Structure/RecentTodoItem.swift index 8a5d1633..57ac2cdc 100644 --- a/DevLog/Presentation/Structure/RecentTodoItem.swift +++ b/DevLog/Presentation/Structure/RecentTodoItem.swift @@ -25,8 +25,4 @@ struct RecentTodoItem: Identifiable, Hashable { self.tags = todo.tags self.category = todo.category } - - func hash(into hasher: inout Hasher) { - hasher.combine(id) - } } diff --git a/DevLog/Presentation/Structure/TodayTodoItem.swift b/DevLog/Presentation/Structure/TodayTodoItem.swift index 9c822f0e..7afd16cc 100644 --- a/DevLog/Presentation/Structure/TodayTodoItem.swift +++ b/DevLog/Presentation/Structure/TodayTodoItem.swift @@ -27,8 +27,4 @@ struct TodayTodoItem: Identifiable, Hashable { self.dueDate = todo.dueDate self.category = todo.category } - - func hash(into hasher: inout Hasher) { - hasher.combine(id) - } } diff --git a/DevLog/Presentation/Structure/UserTodoCategoryItem.swift b/DevLog/Presentation/Structure/UserTodoCategoryItem.swift index cabd7b82..cd3ad23b 100644 --- a/DevLog/Presentation/Structure/UserTodoCategoryItem.swift +++ b/DevLog/Presentation/Structure/UserTodoCategoryItem.swift @@ -21,12 +21,4 @@ struct UserTodoCategoryItem: Identifiable, Hashable { var localizedName: String { userTodoCategory.name } var color: Color { Color(hexString: userTodoCategory.colorHex) ?? .gray } - - static func == (lhs: UserTodoCategoryItem, rhs: UserTodoCategoryItem) -> Bool { - lhs.id == rhs.id - } - - func hash(into hasher: inout Hasher) { - hasher.combine(id) - } } diff --git a/DevLog/Presentation/Structure/WebPageItem.swift b/DevLog/Presentation/Structure/WebPageItem.swift index e2f23660..bc143168 100644 --- a/DevLog/Presentation/Structure/WebPageItem.swift +++ b/DevLog/Presentation/Structure/WebPageItem.swift @@ -19,8 +19,4 @@ struct WebPageItem: Identifiable, Hashable { var url: URL { metadata.url } var displayURL: String { metadata.displayURL.absoluteString } var imageURL: URL? { metadata.imageURL } - - func hash(into hasher: inout Hasher) { - hasher.combine(metadata.url) - } } From 323326586b0644b39897f97ccd9dc532bc31326f Mon Sep 17 00:00:00 2001 From: opficdev Date: Tue, 31 Mar 2026 01:02:17 +0900 Subject: [PATCH 3/4] =?UTF-8?q?style:=20=EB=B3=80=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/TodoManageViewModel.swift | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/DevLog/Presentation/ViewModel/TodoManageViewModel.swift b/DevLog/Presentation/ViewModel/TodoManageViewModel.swift index 4feffe8d..59e939ba 100644 --- a/DevLog/Presentation/ViewModel/TodoManageViewModel.swift +++ b/DevLog/Presentation/ViewModel/TodoManageViewModel.swift @@ -53,13 +53,13 @@ final class TodoManageViewModel: Store { var placeholder: String { guard - let categoryItem = state.category, - case .user(let userTodoCategory) = categoryItem.category + let item = state.category, + case .user(let category) = item.category else { return "이름" } - return userTodoCategory.name + return category.name } var categoryNameCountText: String { @@ -81,13 +81,13 @@ final class TodoManageViewModel: Store { return false } - let trimmedCategoryName = category.name.trimmingCharacters(in: .whitespacesAndNewlines) - if trimmedCategoryName.isEmpty { + let name = category.name.trimmingCharacters(in: .whitespacesAndNewlines) + if name.isEmpty { return false } if SystemTodoCategory.allCases.contains(where: { - $0.rawValue.caseInsensitiveCompare(trimmedCategoryName) == .orderedSame + $0.rawValue.caseInsensitiveCompare(name) == .orderedSame }) { return false } @@ -98,7 +98,7 @@ final class TodoManageViewModel: Store { return false } - return userTodoCategory.name.caseInsensitiveCompare(trimmedCategoryName) == .orderedSame + return userTodoCategory.name.caseInsensitiveCompare(name) == .orderedSame }) { return false } From 2004fd14d00f16a4499bb3ae8d0460b2397cfffd Mon Sep 17 00:00:00 2001 From: opficdev Date: Tue, 31 Mar 2026 01:11:30 +0900 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20=EC=9B=90=EB=B3=B8=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=EA=B3=BC=20=EC=83=89=EC=9D=B4=20=EB=8B=A4=EB=A5=BC=20?= =?UTF-8?q?=EB=95=8C=EB=A7=8C=20=EC=A0=80=EC=9E=A5=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=ED=99=9C=EC=84=B1=ED=99=94=20=EC=A1=B0=EA=B1=B4=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModel/TodoManageViewModel.swift | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/DevLog/Presentation/ViewModel/TodoManageViewModel.swift b/DevLog/Presentation/ViewModel/TodoManageViewModel.swift index 59e939ba..eea980c9 100644 --- a/DevLog/Presentation/ViewModel/TodoManageViewModel.swift +++ b/DevLog/Presentation/ViewModel/TodoManageViewModel.swift @@ -93,16 +93,24 @@ final class TodoManageViewModel: Store { } if state.preferences.contains(where: { item in - guard case .user(let userTodoCategory) = item.category, - userTodoCategory.id != category.id else { + guard case .user(let userCategory) = item.category, + userCategory.id != category.id else { return false } - return userTodoCategory.name.caseInsensitiveCompare(name) == .orderedSame + return userCategory.name.caseInsensitiveCompare(name) == .orderedSame }) { return false } + if let item = state.preferences.first(where: { $0.id == item.id }), + case .user(let originalCategory) = item.category { + let originalName = originalCategory.name.trimmingCharacters(in: .whitespacesAndNewlines) + if originalName == name && originalCategory.colorHex == category.colorHex { + return false + } + } + return true }