Skip to content

Commit

Permalink
Remove search bar from collectionview
Browse files Browse the repository at this point in the history
Move protocols into extensions
General cleanup

Version bump to 1.0.1
  • Loading branch information
lucasderraugh committed Mar 15, 2016
1 parent 6eef1f5 commit ede6e32
Show file tree
Hide file tree
Showing 18 changed files with 180 additions and 215 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ class EateriesCollectionViewGridLayout: UICollectionViewFlowLayout {
override func prepareLayout() {
super.prepareLayout()

enum UIUserInterfaceIdiom : Int {
case Unspecified
case Phone // iPhone and iPod touch style UI
case Pad // iPad style UI
}

guard let collectionView = collectionView else {return}
let width = collectionView.bounds.width
var cellWidth = floor(width / 2 - kCollectionViewGutterWidth * 1.5)
Expand All @@ -28,6 +22,15 @@ class EateriesCollectionViewGridLayout: UICollectionViewFlowLayout {
itemSize = CGSize(width: cellWidth, height: cellWidth * 0.8)
minimumLineSpacing = kCollectionViewGutterWidth
minimumInteritemSpacing = kCollectionViewGutterWidth / 2
sectionInset = UIEdgeInsets(top: 10, left: kCollectionViewGutterWidth, bottom: 20, right: kCollectionViewGutterWidth)
sectionInset = UIEdgeInsets(top: 2, left: kCollectionViewGutterWidth, bottom: 20, right: kCollectionViewGutterWidth)
headerReferenceSize = CGSizeMake(cellWidth, 40)
}

override func collectionViewContentSize() -> CGSize {
var size = super.collectionViewContentSize()
if (size.height < collectionView!.frame.height + 44) {
size.height = collectionView!.frame.height + 44
}
return size
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,27 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="a5k-wW-POb">
<rect key="frame" x="8" y="67" width="304" height="18"/>
<rect key="frame" x="8" y="126" width="304" height="18"/>
<fontDescription key="fontDescription" name="HelveticaNeue-Medium" family="Helvetica Neue" pointSize="15"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="0.5" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstItem="a5k-wW-POb" firstAttribute="centerY" secondItem="QOJ-fU-Qfd" secondAttribute="centerY" id="JQQ-8J-yWb"/>
<constraint firstAttribute="bottom" secondItem="a5k-wW-POb" secondAttribute="bottom" constant="8" id="hOi-OM-c1J"/>
<constraint firstItem="a5k-wW-POb" firstAttribute="leading" secondItem="QOJ-fU-Qfd" secondAttribute="leading" constant="8" id="piR-lL-5ZI"/>
<constraint firstAttribute="trailing" secondItem="a5k-wW-POb" secondAttribute="trailing" constant="8" id="zt0-rx-Oy0"/>
</constraints>
<variation key="default">
<mask key="constraints">
<exclude reference="JQQ-8J-yWb"/>
</mask>
</variation>
<connections>
<outlet property="titleLabel" destination="a5k-wW-POb" id="TEF-Fu-ear"/>
</connections>
<point key="canvasLocation" x="367" y="463"/>
<point key="canvasLocation" x="239" y="461"/>
</collectionReusableView>
</objects>
</document>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ class EateriesCollectionViewTableLayout: UICollectionViewFlowLayout {
itemSize = CGSize(width: width, height: width * 0.4)
minimumLineSpacing = kCollectionViewGutterWidth / 1.2
minimumInteritemSpacing = kCollectionViewGutterWidth / 1.8
sectionInset = UIEdgeInsets(top: 10, left: 0, bottom: 20, right: 0)
sectionInset = UIEdgeInsets(top: 2, left: 0, bottom: 20, right: 0)
headerReferenceSize = CGSizeMake(width, 40)
}

override func collectionViewContentSize() -> CGSize {
var size = super.collectionViewContentSize()
if (size.height < collectionView!.frame.height + 44) {
size.height = collectionView!.frame.height + 44
}
return size
}
}
Loading

0 comments on commit ede6e32

Please sign in to comment.