Skip to content

Commit eec5259

Browse files
committed
Edit collection view layout and animation
1 parent a6334ac commit eec5259

File tree

4 files changed

+4
-76
lines changed

4 files changed

+4
-76
lines changed

Eatery/Controllers/EateriesViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,10 @@ class EateriesViewController: UIViewController, MenuButtonsDelegate, CLLocationM
172172

173173
self.collectionView.isHidden = false
174174

175-
var delay: TimeInterval = 0.0
175+
var delay: TimeInterval = 0.25
176176
for cell in self.collectionView.visibleCells.sorted(by: { $0.frame.origin.y < $1.frame.origin.y }) {
177177
delay += 0.1
178-
UIView.animate(withDuration: 0.55, delay: delay, options: [.allowUserInteraction], animations: {
178+
UIView.animate(withDuration: 0.35, delay: delay, options: [.allowUserInteraction], animations: {
179179
cell.transform = .identity
180180
cell.alpha = 1.0
181181
}, completion: nil)

Eatery/Controllers/FilterBar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class FilterBar: UIView {
8888
if let prevFilters = UserDefaults.standard.stringArray(forKey: "filters") {
8989
for string in prevFilters {
9090
if let filter = Filter(rawValue: string),
91-
let index = filters.index(of: filter) {
91+
let index = filters.index(of: filter), index < buttons.count {
9292
buttons[index].isSelected = true
9393
selectedFilters.insert(filter)
9494
}

Eatery/Layouts/EateriesCollectionViewGridLayout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class EateriesCollectionViewGridLayout: UICollectionViewFlowLayout {
2121
itemSize = CGSize(width: cellWidth, height: cellWidth * 0.4)
2222
minimumLineSpacing = kCollectionViewGutterWidth
2323
minimumInteritemSpacing = kCollectionViewGutterWidth
24-
sectionInset = UIEdgeInsets(top: 8, left: kCollectionViewGutterWidth, bottom: 16, right: kCollectionViewGutterWidth)
24+
sectionInset = UIEdgeInsets(top: 0, left: kCollectionViewGutterWidth, bottom: 32, right: kCollectionViewGutterWidth)
2525
}
2626

2727
override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {

RELEASENOTES.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

0 commit comments

Comments
 (0)