From 64f2eabb4845ff6498213028e1191359afa04161 Mon Sep 17 00:00:00 2001 From: Warif Akhand Rishi Date: Mon, 8 Aug 2016 18:49:14 +0600 Subject: [PATCH] Crash fix - numberOfSectionsInCollectionView zero. Closes brightec/CustomCollectionViewLayout#13 --- CustomCollectionLayout/CustomCollectionViewLayout.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CustomCollectionLayout/CustomCollectionViewLayout.swift b/CustomCollectionLayout/CustomCollectionViewLayout.swift index 998a685..65f295a 100644 --- a/CustomCollectionLayout/CustomCollectionViewLayout.swift +++ b/CustomCollectionLayout/CustomCollectionViewLayout.swift @@ -13,7 +13,7 @@ class CustomCollectionViewLayout: UICollectionViewLayout { let numberOfColumns = 8 var itemAttributes : NSMutableArray! var itemsSize : NSMutableArray! - var contentSize : CGSize! + var contentSize = CGSizeZero override func prepareLayout() { if self.collectionView?.numberOfSections() == 0 {