 		return 1
 	}
 	
-	// MARK: -
+	// MARK: - Navigation bar actions
 	
 	func doneAction() {
 		

			thumbnail.clipsToBounds = true
			cell.contentView.addSubview(thumbnail)
			
			typeIcon = UIImageView(frame: CGRectMake(3, cell.contentView.frame.size.height - 3 - 20, 20, 20))
			typeIcon.contentMode = .ScaleAspectFill
			typeIcon.clipsToBounds = true
			cell.contentView.addSubview(typeIcon)
			
			checkMarkView = CheckMarkView(frame: CGRectMake(cell.contentView.frame.size.width - 3 - 28, 3, 28, 28))
			checkMarkView.backgroundColor = UIColor.clearColor()
			checkMarkView.style = CheckMarkView.CheckMarkStyle.Nothing
			cell.contentView.addSubview(checkMarkView)


class AssetsPickerGridController: UICollectionViewController, UICollectionViewDelegateFlowLayout {
	
	private var assetGridThumbnailSize: CGSize = CGSizeMake(0, 0)
	private let reuseIdentifier = "AssetsGridCell"
	private let typeIconSize = CGSizeMake(20, 20)
	private let checkMarkSize = CGSizeMake(28, 28)
	private let iconOffset: CGFloat = 3
	private let collectionViewEdgeInset: CGFloat = 2
	private let assetsInRow: CGFloat = UIDevice.currentDevice().userInterfaceIdiom == .Phone ? 4 : 8
	
	let cachingImageManager = PHCachingImageManager()
	var collection: PHAssetCollection?
	var selectedIndexes: Set<Int> = Set()
	var didSelectAssets: ((Array<PHAsset!>) -> ())?
	private var assets: [PHAsset]! {
		willSet {
			cachingImageManager.stopCachingImagesForAllAssets()
