From 008e972389c7faece8d986c23bf921fb2c7eee13 Mon Sep 17 00:00:00 2001 From: sunshiningsoo Date: Mon, 9 Sep 2024 19:38:23 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[=EC=88=98=EC=A0=95]=20=EA=B2=80=EC=83=89?= =?UTF-8?q?=EA=B8=B0=EB=A1=9D=20=EC=B5=9C=EC=8B=A0=EC=88=9C=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EC=A0=80=EC=9E=A5=EB=90=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Caches/Dependency/RecentSearch.swift | 2 +- .../Sources/Features/SearchFeatures/Search.swift | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package-kuring/Sources/Caches/Dependency/RecentSearch.swift b/package-kuring/Sources/Caches/Dependency/RecentSearch.swift index 8b35b3fc..6281c0d1 100644 --- a/package-kuring/Sources/Caches/Dependency/RecentSearch.swift +++ b/package-kuring/Sources/Caches/Dependency/RecentSearch.swift @@ -22,7 +22,7 @@ extension RecentSearch { public static let `default` = Self( add: { keyword in var keywords = Self.recentKeywords - keywords.append(keyword) + keywords.insert(keyword, at: 0) Self.recentKeywords = keywords }, remove: { keyword in diff --git a/package-kuring/Sources/Features/SearchFeatures/Search.swift b/package-kuring/Sources/Features/SearchFeatures/Search.swift index 1583c6aa..b0583ff4 100644 --- a/package-kuring/Sources/Features/SearchFeatures/Search.swift +++ b/package-kuring/Sources/Features/SearchFeatures/Search.swift @@ -165,8 +165,12 @@ public struct SearchFeature { // 최근 검색어 추가 if !state.recents.contains(state.searchInfo.text) { // 중복체크 - state.recents.append(state.searchInfo.text) - + state.recents.insert(state.searchInfo.text, at: 0) + recentSearch.add(state.searchInfo.text) + } else if let idx = state.recents.firstIndex(where: {$0 == state.searchInfo.text}) { + state.recents.remove(at: idx) + state.recents.insert(state.searchInfo.text, at: 0) + recentSearch.remove(state.searchInfo.text) recentSearch.add(state.searchInfo.text) } From adffb55f21c294a0a5f25e4fb632d47e1f904630 Mon Sep 17 00:00:00 2001 From: sunshiningsoo Date: Tue, 10 Sep 2024 10:26:01 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[=EC=88=98=EC=A0=95]=20insert=20->=20append?= =?UTF-8?q?=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-kuring/Sources/Caches/Dependency/RecentSearch.swift | 2 +- package-kuring/Sources/Features/SearchFeatures/Search.swift | 4 ++-- package-kuring/Sources/UIKit/SearchUI/SearchView.swift | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-kuring/Sources/Caches/Dependency/RecentSearch.swift b/package-kuring/Sources/Caches/Dependency/RecentSearch.swift index 6281c0d1..8b35b3fc 100644 --- a/package-kuring/Sources/Caches/Dependency/RecentSearch.swift +++ b/package-kuring/Sources/Caches/Dependency/RecentSearch.swift @@ -22,7 +22,7 @@ extension RecentSearch { public static let `default` = Self( add: { keyword in var keywords = Self.recentKeywords - keywords.insert(keyword, at: 0) + keywords.append(keyword) Self.recentKeywords = keywords }, remove: { keyword in diff --git a/package-kuring/Sources/Features/SearchFeatures/Search.swift b/package-kuring/Sources/Features/SearchFeatures/Search.swift index b0583ff4..8ac86d29 100644 --- a/package-kuring/Sources/Features/SearchFeatures/Search.swift +++ b/package-kuring/Sources/Features/SearchFeatures/Search.swift @@ -165,11 +165,11 @@ public struct SearchFeature { // 최근 검색어 추가 if !state.recents.contains(state.searchInfo.text) { // 중복체크 - state.recents.insert(state.searchInfo.text, at: 0) + state.recents.append(state.searchInfo.text) recentSearch.add(state.searchInfo.text) } else if let idx = state.recents.firstIndex(where: {$0 == state.searchInfo.text}) { state.recents.remove(at: idx) - state.recents.insert(state.searchInfo.text, at: 0) + state.recents.append(state.searchInfo.text) recentSearch.remove(state.searchInfo.text) recentSearch.add(state.searchInfo.text) } diff --git a/package-kuring/Sources/UIKit/SearchUI/SearchView.swift b/package-kuring/Sources/UIKit/SearchUI/SearchView.swift index fbeef015..3b1108d2 100644 --- a/package-kuring/Sources/UIKit/SearchUI/SearchView.swift +++ b/package-kuring/Sources/UIKit/SearchUI/SearchView.swift @@ -85,7 +85,7 @@ public struct SearchView: View { /// 최근 검색어 목록 ScrollView(.horizontal, showsIndicators: false) { LazyHStack { - ForEach(store.recents, id: \.self) { recent in + ForEach(store.recents.reversed(), id: \.self) { recent in HStack(alignment: .center, spacing: 6) { Button { store.send(.recentSearchKeywordTapped(recent)) From e02d76dba9e0f96aa6237876973240bacddc62d6 Mon Sep 17 00:00:00 2001 From: sunshiningsoo Date: Tue, 10 Sep 2024 12:42:19 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[=EC=B6=94=EA=B0=80]=20=EB=84=A4=ED=8A=B8?= =?UTF-8?q?=EC=9B=8C=ED=81=AC=20=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=A3=BC?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-kuring/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-kuring/Package.swift b/package-kuring/Package.swift index 29693c07..adff7325 100644 --- a/package-kuring/Package.swift +++ b/package-kuring/Package.swift @@ -51,7 +51,7 @@ let package = Package( name: "BotUI", dependencies: [ .product(name: "Lottie", package: "lottie-spm"), - "ColorSet", "BotFeatures", + "ColorSet", "BotFeatures", "Networks", .product(name: "ComposableArchitecture", package: "swift-composable-architecture"), ], path: "Sources/UIKit/BotUI", From e9422412819f734a263454f0155db156a7180312 Mon Sep 17 00:00:00 2001 From: sunshiningsoo Date: Tue, 10 Sep 2024 13:19:19 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[=EC=88=98=EC=A0=95]=20campusUI=20=ED=8C=A8?= =?UTF-8?q?=ED=82=A4=EC=A7=80=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-kuring/Package.resolved | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-kuring/Package.resolved b/package-kuring/Package.resolved index 01421e10..b33a34ff 100644 --- a/package-kuring/Package.resolved +++ b/package-kuring/Package.resolved @@ -96,7 +96,7 @@ "location" : "https://github.com/ku-ring/ios-maps", "state" : { "branch" : "main", - "revision" : "d0a83b7c3e6b69d77647001f17f162e1090e9489" + "revision" : "35b3e2d67e4f8b180ba0672df988110c992e6f27" } }, { From 8c4d61989228e7674c0cf8a97d39c470ef64d238 Mon Sep 17 00:00:00 2001 From: sunshiningsoo Date: Wed, 11 Sep 2024 23:18:17 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[=EB=B3=80=EA=B2=BD]=20=EB=84=A4=ED=8A=B8?= =?UTF-8?q?=EC=9B=8C=ED=81=AC=20=EC=9D=98=EC=A1=B4=EC=84=B1=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-kuring/Package.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-kuring/Package.swift b/package-kuring/Package.swift index adff7325..29693c07 100644 --- a/package-kuring/Package.swift +++ b/package-kuring/Package.swift @@ -51,7 +51,7 @@ let package = Package( name: "BotUI", dependencies: [ .product(name: "Lottie", package: "lottie-spm"), - "ColorSet", "BotFeatures", "Networks", + "ColorSet", "BotFeatures", .product(name: "ComposableArchitecture", package: "swift-composable-architecture"), ], path: "Sources/UIKit/BotUI",