A Swift implementation of a generic datasource that you can use for table views.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Demo
GenericDatasource/0.1.0
.gitignore
GenericDatasource.swift
LICENSE
README.md
pablo.png

README.md

GenericDatasrouce

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. As the mantra goes - pull requests welcome.