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

Feature/add popular section #23

Merged
merged 8 commits into from
Dec 14, 2017
Merged

Conversation

AntonoffEvgeniy
Copy link
Contributor

Added popular section
Changed Latest Arrivals screen to Base products list screen

@@ -32,14 +33,17 @@ class HomeTableDataSource: NSObject, UITableViewDataSource {
// MARK: - UITableViewDataSource
func numberOfSections(in tableView: UITableView) -> Int {
let lastArrivalsSectionCount = delegate?.lastArrivalsObjects().count ?? 0 > 0 ? 1 : 0
let popularSectionCount = delegate?.popularObjects().count ?? 0 > 0 ? 1 : 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use one of patterns:

if let popularSectionCount = delegate?.popularObjects().count, popularSectionCount > 0
guard let delegate = delegate else { return }
let popularSectionCount = delegate.popularObjects().isEmpty ? 0 : 1

@AntonoffEvgeniy AntonoffEvgeniy merged commit 44ec00a into develop Dec 14, 2017
@AntonoffEvgeniy AntonoffEvgeniy deleted the feature/add_popular_section branch December 14, 2017 10:14
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

2 participants