Build a simple app to fetch a list of movies and implement a search bar to filter by name. You can use an open API for this or a local JSON file to filter out with the search bar.
OMDb API is and open data movies. Due API limitation we dowload several movies searching word = "world". So after do this local implementation we can scale easy to network service
Example of request:
http://omdbapi.com/?apikey=[apikey]&s=world
With this abstraction we can get movies with json file but we can add new implmentations of this protocol from downloading fron network or inject Mocks.
Get movies from repository, show movies in presenter owner (SearchViewcontroller) a filter movies by title
protocol MoviesPresenter: class {
// Presenter Owner <--> Presenter
func moviesToShow(completionHandler: @escaping (Result<[Movie], Error>) -> Void)
func filterMovies(filter: String, completion: @escaping ([Movie]) -> Void )
// Presenter <--> Repository
func getMovies(completion: @escaping (Result<SuccessCode, Error>) -> Void)
}
Show view and communicate with presenter.
- kingfisher for image cache.
- Spinner show async interaction.