Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreaminginbinary/genericdatasource
A Swift implementation of a generic datasource that you can use for table views.
https://github.com/dreaminginbinary/genericdatasource
Last synced: about 1 month ago
JSON representation
A Swift implementation of a generic datasource that you can use for table views.
- Host: GitHub
- URL: https://github.com/dreaminginbinary/genericdatasource
- Owner: DreamingInBinary
- License: mit
- Created: 2015-09-27T03:51:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-06T23:16:44.000Z (over 8 years ago)
- Last Synced: 2024-03-15T04:47:24.725Z (10 months ago)
- Language: Swift
- Size: 269 KB
- Stars: 15
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![GenericDatasrouce](/pablo.png?raw=true "GenericDatasource")
# GenericDatasource
A Swift implementation of a generic datasource that you can use for table views.####Snag it from CocoaPods
pod 'GenericDatasource', ~> '0.1.0'
###What is it for?
This simple class has only one job, to move your datasource logic outside of your controller. That's it :-). There are no tricks or anything special about it, other than it helps promote skinny view controllers.###How do I use it?
Simply set up your GenericDatasource class with the information it needs in its initializer.genericDataSource = GenericTVDatasource(data: data, cellID: "Cell") { cell, item in
//Do any cell configuration here
cell.textLabel?.text = item as? String
}Whenever your table view is initialized, just set its datasource to your `GenericDatasouce` instance:
aTableview.dataSource = genericDataSource
And profit!
###What's coming?
- Support for collection views.
- Ability to specify sections.###Can I tweet at you?
Please do, [@jordanmorgan10](https://twitter.com/jordanmorgan10). As the mantra goes - pull requests welcome.