From bc923f4e29ae67c17422e7ee09af3bc833c093ff Mon Sep 17 00:00:00 2001 From: BoseongKim Date: Fri, 24 Nov 2023 14:35:53 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B#261:=20[=EC=95=B1=20=EB=A6=AC?= =?UTF-8?q?=EC=A0=9D=20=EB=8C=80=EC=9D=91]=20=EC=B6=94=EC=B2=9C=EA=B2=80?= =?UTF-8?q?=EC=83=89=EC=96=B4=20=EA=B2=80=EC=83=89=EA=B2=B0=EA=B3=BC?= =?UTF-8?q?=EA=B9=8C=EC=A7=80=20=EB=82=98=EC=98=A4=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/SearchingMusicViewController.swift | 4 +++- .../ViewModel/SearchingMusicViewModel.swift | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/StreetDrop/StreetDrop/Presentation/SearchingMusicScene/View/SearchingMusicViewController.swift b/StreetDrop/StreetDrop/Presentation/SearchingMusicScene/View/SearchingMusicViewController.swift index 9f896177..5fb65077 100644 --- a/StreetDrop/StreetDrop/Presentation/SearchingMusicScene/View/SearchingMusicViewController.swift +++ b/StreetDrop/StreetDrop/Presentation/SearchingMusicScene/View/SearchingMusicViewController.swift @@ -161,7 +161,8 @@ private extension SearchingMusicViewController { } .disposed(by: disposeBag) - self.recommendMusicSearchCollectionView.queryButtonDidTappedEvent.bind { recentQuery in + self.recommendMusicSearchCollectionView.queryButtonDidTappedEvent + .bind { recentQuery in self.searchTextField.text = recentQuery self.tableView.isHidden = false self.recentMusicSearchView.isHidden = true @@ -191,6 +192,7 @@ private extension SearchingMusicViewController { searchTextFieldEmptyEvent: searchTextFieldEmptyEvent, keyBoardDidPressSearchEventWithKeyword: keyBoardDidPressSearchEventWithKeyword, recentQueryDidPressEvent: self.recentMusicSearchScrollView.queryButtonDidTappedEvent, + recommendQueryDidPressEvent: self.recommendMusicSearchCollectionView.queryButtonDidTappedEvent, tableViewCellDidPressedEvent: selectedTableViewCellEvent ) let output = viewModel.convert(input: input, disposedBag: disposeBag) diff --git a/StreetDrop/StreetDrop/Presentation/SearchingMusicScene/ViewModel/SearchingMusicViewModel.swift b/StreetDrop/StreetDrop/Presentation/SearchingMusicScene/ViewModel/SearchingMusicViewModel.swift index 40887d17..76de87be 100644 --- a/StreetDrop/StreetDrop/Presentation/SearchingMusicScene/ViewModel/SearchingMusicViewModel.swift +++ b/StreetDrop/StreetDrop/Presentation/SearchingMusicScene/ViewModel/SearchingMusicViewModel.swift @@ -28,6 +28,7 @@ final class DefaultSearchingMusicViewModel: SearchingMusicViewModel { let searchTextFieldEmptyEvent: Observable let keyBoardDidPressSearchEventWithKeyword: Observable let recentQueryDidPressEvent: PublishRelay + let recommendQueryDidPressEvent: PublishRelay let tableViewCellDidPressedEvent: Observable } @@ -94,6 +95,12 @@ final class DefaultSearchingMusicViewModel: SearchingMusicViewModel { } .disposed(by: disposedBag) + input.recommendQueryDidPressEvent + .bind { [weak self] recommendQuery in + self?.searchMusic(output: output, keyword: recommendQuery) + } + .disposed(by: disposedBag) + input.tableViewCellDidPressedEvent .bind { [weak self] indexPathRow in guard let self = self else { return }