Skip to content

Instantly share code, notes, and snippets.

@NikhilManapure
Last active January 10, 2017 05:17
Show Gist options
  • Save NikhilManapure/49dd3e0e4de7db44c993471af0cf3c24 to your computer and use it in GitHub Desktop.
Save NikhilManapure/49dd3e0e4de7db44c993471af0cf3c24 to your computer and use it in GitHub Desktop.
Bad way to write cellForRowAt
override func tableView(_ tableView: UITableView,
cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// Clean up
if [self.subviews containsObject: self.someNotoriousView] {
[self.contentView removeFromSuperview];
}
// Set up(adding that notorious view again based on some condition )
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment