Skip to content

Instantly share code, notes, and snippets.

@klundberg
Created August 27, 2015 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klundberg/9f8f5a0d4921cf2ab3b8 to your computer and use it in GitHub Desktop.
Save klundberg/9f8f5a0d4921cf2ab3b8 to your computer and use it in GitHub Desktop.
struct TableViewSection<T, Cell: UITableViewCell> {
var cellIdentifier: String = ""
var items: [T] = []
var configureCell: (cell: Cell, item: T, indexPath: NSIndexPath) -> Void
}
class TableViewDataSource: NSObject, UITableViewDataSource {
var sections: [TableViewSection<?, ?>] = [] // I want arbitrary T/Cell types here, what do?
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment