Skip to content
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

Open
wants to merge 9 commits into
base: main-jonathan-hernandez
Choose a base branch
from

Conversation

RockonSkroc
Copy link
Collaborator

Interface Home MVP




class GenericMovieCollectionView: UICollectionView {

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 {

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]]!

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

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!

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("")

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 {

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?

case popularity
}

func hash(into hasher: inout Hasher) {

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 {

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()

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants