Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tableView:cellForRowAtIndexPath using UITableViewCell class with preset style
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell: UITableViewCell?
cell = tableView.dequeueReusableCellWithIdentifier(UITableViewCell.wta_reuseableIdentifier())
if cell == nil {
cell = UITableViewCell(style: .Value1, reuseIdentifier: UITableViewCell.wta_reuseableIdentifier())
}
if let result = viewModel?.results.value[indexPath.row] {
cell!.textLabel!.text = result.name
cell!.detailTextLabel!.text = result.phone
}
return cell!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.