Skip to content

Commit

Permalink
fix issue #14 - release year is sometimes missing in search results - u…
Browse files Browse the repository at this point in the history
  • Loading branch information
Brent Mifsud committed Jun 2, 2019
1 parent e3e74d9 commit bc0231c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion TheMovieManager/Controller/SearchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ extension SearchViewController: UITableViewDataSource, UITableViewDelegate {

let movie = movies[indexPath.row]

cell.textLabel?.text = "\(movie.title) - \(movie.releaseYear)"
cell.textLabel?.text = "\(movie.title)"

if !movie.releaseYear.isEmpty {
cell.textLabel?.text?.append(" - \(movie.releaseYear)")
}

cell.imageView?.image = UIImage(named: "PosterPlaceholder")

if let posterPath = movie.posterPath {
Expand Down

0 comments on commit bc0231c

Please sign in to comment.