         }
         
         fetchedController = createFetchedController()
-        fetchedController.delegate = self
+        fetchedController!.delegate = self
         
         collectionView.reloadData()
     }
     
     public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        let sections:[NSFetchedResultsSectionInfo] = fetchedController.sections! as [NSFetchedResultsSectionInfo]
+        guard let controller = fetchedController else {
+            return 0
+        }
+        
+        let sections:[NSFetchedResultsSectionInfo] = controller.sections! as [NSFetchedResultsSectionInfo]
         return sections[section].numberOfObjects
     }
     

    }
    
    public func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
        let object = fetchedController.objectAtIndexPath(indexPath)
        configureCell(measuringCell!, atIndexPath: indexPath, object: object, forMeasuring:true)
        let height = calculateHeightForConfiguredSizingCell(measuringCell!)
        return CGSizeMake(CGRectGetWidth(collectionView.frame), height)

public class FetchedCollectionViewController: UIViewController, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, NSFetchedResultsControllerDelegate {
    
    @IBOutlet public var collectionView: UICollectionView!
    private var fetchedController: NSFetchedResultsController?
    private var measuringCell: UICollectionViewCell?
    private var changeActions: [CollectionCoreDataChangeAction]!
    
