Created
November 2, 2018 07:12
-
-
Save Bandd-k/cf9ebb26296fa0092996eca2fb0aed4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Section<CellType: UICollectionViewCell, ModelType: AnyObject> { | |
var numberOfItems: Int { return elements.count } | |
var elements: [ModelType] | |
var identifier: String { return String(describing: type(of: ModelType.self)) } | |
var configurator: CollectionCellConfigurator<CellType, ModelType> | |
} | |
protocol Configurator { | |
var configureCell: (UICollectionViewCell, AnyObject) -> () { get set } | |
} | |
struct CollectionCellConfigurator<Cell: UICollectionViewCell, Item: AnyObject>: Configurator { | |
let configureCell: (Cell, Item) -> () | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment