Skip to content

Instantly share code, notes, and snippets.

@RuiAAPeres
Last active January 10, 2016 20:26
Show Gist options
  • Select an option

  • Save RuiAAPeres/d49ec71b53873d9b43b6 to your computer and use it in GitHub Desktop.

Select an option

Save RuiAAPeres/d49ec71b53873d9b43b6 to your computer and use it in GitHub Desktop.
class TableDataSource: UITableViewDataSource {
let viewModels: [ViewModel]
init(viewModels: [ViewModel]) {
self.viewModels = viewModels
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let identifier = ?
let cell = tableView.dequeueReusableCellWithIdentifier(identifier, forIndexPath: indexPath) as! ChannelCell
cell.viewModel = viewModel
return cell
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment