Skip to content

Commit 279331a

Browse files
committed
Updating to work with cocoapods
1 parent 0ccb231 commit 279331a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

CollectionViewWaterfallLayout.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import UIKit
1212
let CollectionViewWaterfallElementKindSectionHeader = "CollectionViewWaterfallElementKindSectionHeader"
1313
let CollectionViewWaterfallElementKindSectionFooter = "CollectionViewWaterfallElementKindSectionFooter"
1414

15-
@objc protocol CollectionViewWaterfallLayoutDelegate:UICollectionViewDelegate {
15+
@objc public protocol CollectionViewWaterfallLayoutDelegate:UICollectionViewDelegate {
1616

1717
func collectionView(collectionView: UICollectionView, layout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
1818

@@ -30,49 +30,49 @@ let CollectionViewWaterfallElementKindSectionFooter = "CollectionViewWaterfallEl
3030

3131
}
3232

33-
class CollectionViewWaterfallLayout: UICollectionViewLayout {
33+
public class CollectionViewWaterfallLayout: UICollectionViewLayout {
3434

3535
//MARK: Private constants
3636
/// How many items to be union into a single rectangle
3737
private let unionSize = 20;
3838

3939
//MARK: Public Properties
40-
var columnCount:Int = 2 {
40+
public var columnCount:Int = 2 {
4141
didSet {
4242
invalidateIfNotEqual(oldValue, newValue: columnCount)
4343
}
4444
}
45-
var minimumColumnSpacing:Float = 10.0 {
45+
public var minimumColumnSpacing:Float = 10.0 {
4646
didSet {
4747
invalidateIfNotEqual(oldValue, newValue: minimumColumnSpacing)
4848
}
4949
}
50-
var minimumInteritemSpacing:Float = 10.0 {
50+
public var minimumInteritemSpacing:Float = 10.0 {
5151
didSet {
5252
invalidateIfNotEqual(oldValue, newValue: minimumInteritemSpacing)
5353
}
5454
}
55-
var headerHeight:Float = 0.0 {
55+
public var headerHeight:Float = 0.0 {
5656
didSet {
5757
invalidateIfNotEqual(oldValue, newValue: headerHeight)
5858
}
5959
}
60-
var footerHeight:Float = 0.0 {
60+
public var footerHeight:Float = 0.0 {
6161
didSet {
6262
invalidateIfNotEqual(oldValue, newValue: footerHeight)
6363
}
6464
}
65-
var headerInset:UIEdgeInsets = UIEdgeInsetsZero {
65+
public var headerInset:UIEdgeInsets = UIEdgeInsetsZero {
6666
didSet {
6767
invalidateIfNotEqual(NSValue(UIEdgeInsets: oldValue), newValue: NSValue(UIEdgeInsets: headerInset))
6868
}
6969
}
70-
var footerInset:UIEdgeInsets = UIEdgeInsetsZero {
70+
public var footerInset:UIEdgeInsets = UIEdgeInsetsZero {
7171
didSet {
7272
invalidateIfNotEqual(NSValue(UIEdgeInsets: oldValue), newValue: NSValue(UIEdgeInsets: footerInset))
7373
}
7474
}
75-
var sectionInset:UIEdgeInsets = UIEdgeInsetsZero {
75+
public var sectionInset:UIEdgeInsets = UIEdgeInsetsZero {
7676
didSet {
7777
invalidateIfNotEqual(NSValue(UIEdgeInsets: oldValue), newValue: NSValue(UIEdgeInsets: sectionInset))
7878
}
@@ -93,7 +93,7 @@ class CollectionViewWaterfallLayout: UICollectionViewLayout {
9393

9494

9595
//MARK: UICollectionViewLayout Methods
96-
override func prepareLayout() {
96+
override public func prepareLayout() {
9797
super.prepareLayout()
9898

9999
let numberOfSections = collectionView?.numberOfSections()
@@ -261,7 +261,7 @@ class CollectionViewWaterfallLayout: UICollectionViewLayout {
261261
}
262262
}
263263

264-
override func collectionViewContentSize() -> CGSize {
264+
override public func collectionViewContentSize() -> CGSize {
265265
let numberOfSections = collectionView?.numberOfSections()
266266
if numberOfSections == 0 {
267267
return CGSizeZero
@@ -273,7 +273,7 @@ class CollectionViewWaterfallLayout: UICollectionViewLayout {
273273
return contentSize!
274274
}
275275

276-
override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes! {
276+
override public func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes! {
277277
if indexPath.section >= sectionItemAttributes.count {
278278
return nil
279279
}
@@ -285,7 +285,7 @@ class CollectionViewWaterfallLayout: UICollectionViewLayout {
285285
return sectionItemAttributes[indexPath.section][indexPath.item]
286286
}
287287

288-
override func layoutAttributesForSupplementaryViewOfKind(elementKind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes! {
288+
override public func layoutAttributesForSupplementaryViewOfKind(elementKind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes! {
289289
var attribute: UICollectionViewLayoutAttributes?
290290

291291
if elementKind == CollectionViewWaterfallElementKindSectionHeader {
@@ -298,7 +298,7 @@ class CollectionViewWaterfallLayout: UICollectionViewLayout {
298298
return attribute
299299
}
300300

301-
override func layoutAttributesForElementsInRect(rect: CGRect) -> [AnyObject] {
301+
override public func layoutAttributesForElementsInRect(rect: CGRect) -> [AnyObject] {
302302
var begin:Int = 0
303303
var end: Int = unionRects.count
304304
var attrs = [UICollectionViewLayoutAttributes]()
@@ -325,7 +325,7 @@ class CollectionViewWaterfallLayout: UICollectionViewLayout {
325325
return Array(attrs)
326326
}
327327

328-
override func shouldInvalidateLayoutForBoundsChange(newBounds: CGRect) -> Bool {
328+
override public func shouldInvalidateLayoutForBoundsChange(newBounds: CGRect) -> Bool {
329329
let oldBounds = collectionView?.bounds
330330
if CGRectGetWidth(newBounds) != CGRectGetWidth(oldBounds!) {
331331
return true

0 commit comments

Comments
 (0)