Skip to content

Instantly share code, notes, and snippets.

@mdflores
Last active January 3, 2019 05:58
Show Gist options
  • Save mdflores/dada83142515cf93960bb7c64b23c9e2 to your computer and use it in GitHub Desktop.
Save mdflores/dada83142515cf93960bb7c64b23c9e2 to your computer and use it in GitHub Desktop.
Safe Scroll To Bottom in TableView using Content Height
extension UITableView {
func scrollToBottom(animated: Bool) {
let scrollPoint = CGPoint(x: 0, y: self.contentSize.height - self.frame.size.height)
self.setContentOffset(scrollPoint, animated: animated)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment