Skip to content

Instantly share code, notes, and snippets.

@ilyapuchka
Created December 28, 2015 16:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyapuchka/0dd49e52f96988f7ca34 to your computer and use it in GitHub Desktop.
Save ilyapuchka/0dd49e52f96988f7ca34 to your computer and use it in GitHub Desktop.
UITableView subclass that wraps it's content
class EmbededTableView: UITableView {
override func intrinsicContentSize() -> CGSize {
layoutIfNeeded()
return CGSizeMake(UIViewNoIntrinsicMetric, self.contentSize.height)
}
override func reloadData() {
super.reloadData()
invalidateIntrinsicContentSize()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment