Skip to content

Commit

Permalink
Merge branch 'release/0.9.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
chiahsien committed May 9, 2015
2 parents 7d8ee86 + 489634c commit 2b32dcc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CHTCollectionViewWaterfallLayout.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "CHTCollectionViewWaterfallLayout"
s.version = "0.9"
s.version = "0.9.1"
s.summary = "The waterfall (i.e., Pinterest-like) layout for UICollectionView."
s.homepage = "https://github.com/chiahsien/CHTCollectionViewWaterfallLayout"
s.screenshots = "https://raw.github.com/chiahsien/UICollectionViewWaterfallLayout/master/Screenshots/2-columns.png"
Expand Down
20 changes: 10 additions & 10 deletions CHTCollectionViewWaterfallLayout.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ import UIKit
func collectionView (collectionView: UICollectionView,layout collectionViewLayout: UICollectionViewLayout,
sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize

optional func colletionView (collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
optional func collectionView (collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
heightForHeaderInSection section: NSInteger) -> CGFloat

optional func colletionView (collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
optional func collectionView (collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
heightForFooterInSection section: NSInteger) -> CGFloat

optional func colletionView (collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
optional func collectionView (collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
insetForSectionAtIndex section: NSInteger) -> UIEdgeInsets

optional func colletionView (collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
optional func collectionView (collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,
minimumInteritemSpacingForSectionAtIndex section: NSInteger) -> CGFloat
}

Expand Down Expand Up @@ -114,7 +114,7 @@ class CHTCollectionViewWaterfallLayout : UICollectionViewLayout{

func itemWidthInSectionAtIndex (section : NSInteger) -> CGFloat {
var insets : UIEdgeInsets
if let sectionInsets = self.delegate?.colletionView?(self.collectionView!, layout: self, insetForSectionAtIndex: section){
if let sectionInsets = self.delegate?.collectionView?(self.collectionView!, layout: self, insetForSectionAtIndex: section){
insets = sectionInsets
}else{
insets = self.sectionInset
Expand Down Expand Up @@ -153,14 +153,14 @@ class CHTCollectionViewWaterfallLayout : UICollectionViewLayout{
* 1. Get section-specific metrics (minimumInteritemSpacing, sectionInset)
*/
var minimumInteritemSpacing : CGFloat
if let miniumSpaceing = self.delegate?.colletionView?(self.collectionView!, layout: self, minimumInteritemSpacingForSectionAtIndex: section){
if let miniumSpaceing = self.delegate?.collectionView?(self.collectionView!, layout: self, minimumInteritemSpacingForSectionAtIndex: section){
minimumInteritemSpacing = miniumSpaceing
}else{
minimumInteritemSpacing = self.minimumColumnSpacing
}

var sectionInsets : UIEdgeInsets
if let insets = self.delegate?.colletionView?(self.collectionView!, layout: self, insetForSectionAtIndex: section){
if let insets = self.delegate?.collectionView?(self.collectionView!, layout: self, insetForSectionAtIndex: section){
sectionInsets = insets
}else{
sectionInsets = self.sectionInset
Expand All @@ -174,7 +174,7 @@ class CHTCollectionViewWaterfallLayout : UICollectionViewLayout{
* 2. Section header
*/
var heightHeader : CGFloat
if let height = self.delegate?.colletionView?(self.collectionView!, layout: self, heightForHeaderInSection: section){
if let height = self.delegate?.collectionView?(self.collectionView!, layout: self, heightForHeaderInSection: section){
heightHeader = height
}else{
heightHeader = self.headerHeight
Expand Down Expand Up @@ -227,7 +227,7 @@ class CHTCollectionViewWaterfallLayout : UICollectionViewLayout{
let columnIndex = self.longestColumnIndex()
top = CGFloat(self.columnHeights.objectAtIndex(columnIndex).floatValue) - minimumInteritemSpacing + sectionInset.bottom

if let height = self.delegate?.colletionView?(self.collectionView!, layout: self, heightForFooterInSection: section){
if let height = self.delegate?.collectionView?(self.collectionView!, layout: self, heightForFooterInSection: section){
footerHeight = height
}else{
footerHeight = self.footerHeight
Expand Down Expand Up @@ -384,4 +384,4 @@ class CHTCollectionViewWaterfallLayout : UICollectionViewLayout{
}
return index
}
}
}

0 comments on commit 2b32dcc

Please sign in to comment.