Skip to content

A Swift implementation of a generic datasource that you can use for table views.

License

Notifications You must be signed in to change notification settings

DreamingInBinary/GenericDatasource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Swift implementation of a generic datasource that you can use for table views.

Resources

License

Stars

Watchers

Forks

Packages

No packages published