Last active
March 7, 2017 15:42
-
-
Save bsmith11/30616d2aa33d169c54311d7c5783f32f to your computer and use it in GitHub Desktop.
DataSource snippet
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
public typealias ReloadBlock = ([IndexPath]) -> Void | |
public protocol DataSource { | |
associatedtype ModelType | |
var reloadBlock: ReloadBlock? { get set } | |
var numberOfSections: Int { get } | |
func numberOfItems(in section: Int) -> Int | |
func item(at indexPath: IndexPath) -> ModelType? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment