Skip to content
This repository has been archived by the owner on Dec 31, 2023. It is now read-only.

[1.0.0] 최근 검색어를 저장하는 로직을 추가합니다. #2

Closed
wants to merge 14 commits into from

Conversation

lgvv
Copy link
Member

@lgvv lgvv commented Jun 8, 2022

최근 검색어를 저장하는 로직을 추가했습니다.

검색어는 최근 검색어가 제일 앞쪽에 위치합니다.
이미 존재하는 검색어는 자동으로 사라지고, 좌우로 스크롤이 가능하게 만들었습니다.
또한 검색어 선택시, 자동으로 선택하여 검색을 수행합니다.
검색어 옆에 X버튼을 클릭하면 최근 검색어에서 사라집니다.

@lgvv lgvv self-assigned this Jun 8, 2022
Comment on lines 56 to 60
//struct SearchedRecentList_Previews: PreviewProvider {
// static var previews: some View {
// SearchedRecentList()
// }
//}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주석 부분(사용하지 않는 코드)은 지워주세요

Comment on lines +9 to +17

class AppStorageManager {
static let shared = AppStorageManager()

private init() { }

@AppStorage(StringSet.recentSearch)
var recentSearch: [String] = UserDefaults.standard.array(forKey: StringSet.recentSearch) as? [String] ?? []
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnvironmentObject 가 있기 때문에 싱글톤 패턴의 매니저는 제거하도록 하겠습니다.

@x-0o0 x-0o0 added duplicate This issue or pull request already exists and removed work in progress labels Jun 8, 2022
@x-0o0
Copy link
Contributor

x-0o0 commented Jun 8, 2022

Close because it's duplicated with pull/3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants