Skip to content

Instantly share code, notes, and snippets.

@ka-interview
ka-interview / gist:a6478004c6cee552f225
Created October 14, 2014 23:57
Sketch of type safe, non-AnyObject-supporting data source
public protocol CountableCollectionType: CollectionType {
var count: Int { get }
}
extension Array: CountableCollectionType {}
public protocol CollectionViewCellFactoryType {
typealias Item
typealias Cell: UICollectionViewCell
func cellForItem(item: Item, inCollectionView collectionView: UICollectionView, atIndexPath indexPath: NSIndexPath) -> Cell