-
Notifications
You must be signed in to change notification settings - Fork 13
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
Untitled Pull Request #47
base: main-jonathan-hernandez
Are you sure you want to change the base?
Conversation
|
||
|
||
|
||
class GenericMovieCollectionView: UICollectionView { |
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.
Please avoid adding commented code to your commits.
|
||
} | ||
|
||
extension GenericTableViewController: UITableViewDelegate, UITableViewDataSource { |
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.
Same here: Please avoid adding commented code to your commits.
|
||
class HomeViewController: UIViewController, HomeView { | ||
|
||
var arrMovies: [SectionMovie: [Movie]]! |
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.
Please avoid force unwrap properties "!"
class HomeViewController: UIViewController, HomeView { | ||
|
||
var arrMovies: [SectionMovie: [Movie]]! | ||
var dataSource: UICollectionViewDiffableDataSource<SectionMovie, Movie>! = nil |
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.
Same here: Please avoid force unwrap properties "!"
return searchController | ||
}() | ||
|
||
var movieHomeCollectionView: UICollectionView! |
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.
Same here: Please avoid force unwrap properties "!"
You can declare this view like this: private lazy var movieHomeCollectionView: UICollectionView = { }()
The same you did with the searchController
.
var tableView: UITableView! | ||
|
||
func showEmptyState() { | ||
print("") |
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.
If this is meant to be updated in the future please try to add // TODO: comments in the method's body.
let voteCount: Int? | ||
let popularity: Double? | ||
|
||
enum CodingKeys: String, CodingKey { |
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.
Do you think this CodingKeys declaration can be private?
TheMovieDb/Models/Movie.swift
Outdated
case popularity | ||
} | ||
|
||
func hash(into hasher: inout Hasher) { |
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.
Just a question: Why do you require this struct to be Hashable
?
decode: @escaping (Decodable) -> T?, | ||
completion: @escaping (Result<T, APIError>) -> Void) { | ||
let task = decodingTask(with: request, decodingType: T.self) { (json, error) in | ||
DispatchQueue.main.async { |
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.
Just a question: Should the APIClient be responsible for handling the response in the main thread?
|
||
var title: String? { | ||
didSet { | ||
configure() |
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.
I have my doubts about this configure() method each time you assign these properties.
Interface Home MVP