     }
     
     override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return 1;
+        var item: AnyObject = items[section]
+        
+        switch item {
+        case let app as App:
+            return 1
+        case let folder as Folder:
+            return folder.apps.count
+        default:
+            return 0
+        }
     }
     
     override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

            App(name: "App 1", color: UIColor.greenColor()),
            App(name: "App 2", color: UIColor.blueColor()),
            App(name: "App 3", color: UIColor.redColor()),
            Folder(name: "Folder 1", apps: [
                App(name: "App 4", color: UIColor.purpleColor()),
                App(name: "App 5", color: UIColor.grayColor()),
                App(name: "App 6", color: UIColor.yellowColor()),
            ]),
            Folder(name: "Folder 2", apps: [])
        ]
    }


        case let app as App:
            cell.backgroundColor = app.color
        case let folder as Folder:
            cell.backgroundColor = folder.apps[indexPath.row].color
        default:
            cell.backgroundColor = UIColor.whiteColor()
        }
