Created
December 28, 2015 16:14
-
-
Save ilyapuchka/0dd49e52f96988f7ca34 to your computer and use it in GitHub Desktop.
UITableView subclass that wraps it's content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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