Commit 2f869099 authored by Zach Knox's avatar Zach Knox
Browse files

Look at how well those collection view cells resize! It's PERFECT*!

Until there's like a 24 inch iPad or something then it'll look kind of weird
parent 16600fff
......@@ -41,14 +41,27 @@ class LocationsListViewController: UIViewController, UICollectionViewDelegate, U
let refreshControl = UIRefreshControl()
override func viewWillLayoutSubviews() {
let windowWidth = self.view.frame.size.width
if(windowWidth > 320 && windowWidth < 640) {
LocationsListLayout.itemSize.width = windowWidth - 20
}
else if(windowWidth >= 640 && windowWidth < 1024) {
LocationsListLayout.itemSize.width = (windowWidth / 2) - 15
}
else if(windowWidth >= 1024) {
LocationsListLayout.itemSize.width = (windowWidth / 3) - 15
}
LocationsListLayout.invalidateLayout()
}
override func viewDidLoad() {
super.viewDidLoad()
//This code makes it look good on an iPhone SE
let windowWidth = self.view.frame.size.width
if(windowWidth <= 320) {
LocationsListLayout.itemSize.width = 300
}
LocationsListLayout.invalidateLayout()
LocationsListLayout.sectionInset = UIEdgeInsetsMake(10, 10, 10, 10)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment