Skip to content

Commit

Permalink
πŸ›#261: [μ•± 리젝 λŒ€μ‘] μΆ”μ²œκ²€μƒ‰μ–΄ κ²€μƒ‰κ²°κ³ΌκΉŒμ§€ λ‚˜μ˜€μ§€ μ•ŠμŒ
Browse files Browse the repository at this point in the history
  • Loading branch information
boseongv committed Nov 26, 2023
1 parent 79656ef commit 56cd230
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ final class DefaultSearchingMusicViewModel: SearchingMusicViewModel {
let searchTextFieldEmptyEvent: Observable<Void>
let keyBoardDidPressSearchEventWithKeyword: Observable<String>
let recentQueryDidPressEvent: PublishRelay<String>
let recommendQueryDidPressEvent: PublishRelay<String>
let tableViewCellDidPressedEvent: Observable<Int>
}

Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit 56cd230

Please sign in to comment.