Skip to content

Commit

Permalink
Edit collection view layout and animation
Browse files Browse the repository at this point in the history
  • Loading branch information
dantheli committed Aug 28, 2017
1 parent a6334ac commit eec5259
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 76 deletions.
4 changes: 2 additions & 2 deletions Eatery/Controllers/EateriesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ class EateriesViewController: UIViewController, MenuButtonsDelegate, CLLocationM

self.collectionView.isHidden = false

var delay: TimeInterval = 0.0
var delay: TimeInterval = 0.25
for cell in self.collectionView.visibleCells.sorted(by: { $0.frame.origin.y < $1.frame.origin.y }) {
delay += 0.1
UIView.animate(withDuration: 0.55, delay: delay, options: [.allowUserInteraction], animations: {
UIView.animate(withDuration: 0.35, delay: delay, options: [.allowUserInteraction], animations: {
cell.transform = .identity
cell.alpha = 1.0
}, completion: nil)
Expand Down
2 changes: 1 addition & 1 deletion Eatery/Controllers/FilterBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class FilterBar: UIView {
if let prevFilters = UserDefaults.standard.stringArray(forKey: "filters") {
for string in prevFilters {
if let filter = Filter(rawValue: string),
let index = filters.index(of: filter) {
let index = filters.index(of: filter), index < buttons.count {
buttons[index].isSelected = true
selectedFilters.insert(filter)
}
Expand Down
2 changes: 1 addition & 1 deletion Eatery/Layouts/EateriesCollectionViewGridLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class EateriesCollectionViewGridLayout: UICollectionViewFlowLayout {
itemSize = CGSize(width: cellWidth, height: cellWidth * 0.4)
minimumLineSpacing = kCollectionViewGutterWidth
minimumInteritemSpacing = kCollectionViewGutterWidth
sectionInset = UIEdgeInsets(top: 8, left: kCollectionViewGutterWidth, bottom: 16, right: kCollectionViewGutterWidth)
sectionInset = UIEdgeInsets(top: 0, left: kCollectionViewGutterWidth, bottom: 32, right: kCollectionViewGutterWidth)
}

override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
Expand Down
72 changes: 0 additions & 72 deletions RELEASENOTES.md

This file was deleted.

0 comments on commit eec5259

Please sign in to comment.