-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
task 12008+09+10: Search Movie Screen: Create UI + Handle Event + Fetch API #8
base: master
Are you sure you want to change the base?
Conversation
ready |
@@ -121,6 +121,12 @@ final class MovieDetailViewController: UIViewController, AlertViewController, Bi | |||
output.error | |||
.drive(errorBinding) | |||
.disposed(by: disposeBag) | |||
Observable.of(output.titleMovie.mapToVoid().asObservable(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xử lý trong viewmodel
let movieRepository: MovieRepository | ||
let genreRepository: GenreReponsitory | ||
|
||
func searchMovie(query: String, page: Int) -> Observable<([Movie], Int)> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Khai báo class với generic và page chứ k truyền tuple thế này
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Khai báo class với generic và page chứ k truyền tuple thế này
Em chưa hiểu lắm, anh có thể lấy ví dụ được không?
}) | ||
let selectMovie = input.movieSelectTrigger | ||
.withLatestFrom(movies.asDriver()) { indexPath, movies in | ||
return (movies[indexPath.row], indexPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (movies[indexPath.row], indexPath) | |
return ($1[$0.row], $0) |
return self.selectedGenres | ||
.asDriver() | ||
.map { genres in | ||
return genres.filter { $0.selected }.map { $0.id } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return genres.filter { $0.selected }.map { $0.id } | |
return genres.filter { $0.selected } | |
.map { $0.id } |
.mapToVoid() | ||
let paging = input.pageTrigger | ||
.withLatestFrom(isSearching.asDriver(onErrorJustReturn: false)) { page, isSearching in | ||
return (page, isSearching) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return (page, isSearching) | |
return ($0, $1) |
Issue Link 🔗
https://edu-redmine.sun-asterisk.vn/issues/12007
Goals ⚽
----Create UI:
https://marvelapp.com/be90ba4/screen/56474035
----Handle Event:
Fetch data and display to UI:
Implementation Details 🚧
https://gfycat.com/FeistySadCrocodile