         callback?(row)
     }
 
+    func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
+        return cellSize
+    }
+    
     func isHighlight(asset: PHAsset) -> Bool {
         for highlightRow in highlightRows {
             if highlightRow == asset {

import UIKit
import Photos

class ImagePickerCollectionView: UICollectionView, UICollectionViewDataSource, UICollectionViewDelegate {

    let manager = PHImageManager.defaultManager()
    var rows = [PHAsset]()
    var highlightRows = [PHAsset]()
    var callback: (PHAsset -> Void)?

    override func awakeFromNib() {
        super.awakeFromNib()

        self.registerNib(nib, forCellWithReuseIdentifier: "ImageCell")
        self.delegate = self
        self.dataSource = self
        let width = (UIScreen.mainScreen().bounds.size.width / 4)
        self.cellSize = CGSize(width: width, height: width)
    }


