Skip to content

Instantly share code, notes, and snippets.

@Myrrel
Created March 10, 2024 18:00
Show Gist options
  • Save Myrrel/808fcb4d476303b2727fb42e33d84ee6 to your computer and use it in GitHub Desktop.
Save Myrrel/808fcb4d476303b2727fb42e33d84ee6 to your computer and use it in GitHub Desktop.
iOS 14 — Modern Cell Configuration
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
let item = items[indexPath.row]
var content = cell.defaultContentConfiguration()
content.image = UIImage(systemName: "star")
content.text = "Hello!"
cell.contentConfiguration = content
return cell
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment