Skip to content

Instantly share code, notes, and snippets.

@nashysolutions
Last active November 12, 2020 19:12
Show Gist options
  • Save nashysolutions/2726cd8c0019b0bc39a78699fc8db653 to your computer and use it in GitHub Desktop.
Save nashysolutions/2726cd8c0019b0bc39a78699fc8db653 to your computer and use it in GitHub Desktop.
private typealias CellProvider = (UITableView, IndexPath, MenuItem) -> UITableViewCell?
private let cellProvider: CellProvider = { (tableView, indexPath, item) -> UITableViewCell? in
let cell = tableView.dequeueReusableCell(
withIdentifier: MenuItemTableViewCell.identifier,
for: indexPath) as! MenuItemTableViewCell
cell.accessoryType = item.isSelected ? .checkmark : .none
cell.textLabel?.text = item.name
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment