Skip to content

Commit bc0231c

Browse files
author
Brent Mifsud
committed
fix issue #14 - release year is sometimes missing in search results - udacity/ios-nd-networking#14
1 parent e3e74d9 commit bc0231c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

TheMovieManager/Controller/SearchViewController.swift

+6-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ extension SearchViewController: UITableViewDataSource, UITableViewDelegate {
6969

7070
let movie = movies[indexPath.row]
7171

72-
cell.textLabel?.text = "\(movie.title) - \(movie.releaseYear)"
72+
cell.textLabel?.text = "\(movie.title)"
73+
74+
if !movie.releaseYear.isEmpty {
75+
cell.textLabel?.text?.append(" - \(movie.releaseYear)")
76+
}
77+
7378
cell.imageView?.image = UIImage(named: "PosterPlaceholder")
7479

7580
if let posterPath = movie.posterPath {

0 commit comments

Comments
 (0)