Skip to content

Instantly share code, notes, and snippets.

@thecoolwinter
Created April 12, 2021 09:46
Show Gist options
  • Save thecoolwinter/bca206abb61a95de3acd6105177a3b24 to your computer and use it in GitHub Desktop.
Save thecoolwinter/bca206abb61a95de3acd6105177a3b24 to your computer and use it in GitHub Desktop.
import UIKit
final class ContentSizedTableView: UITableView {
override var contentSize:CGSize {
didSet {
invalidateIntrinsicContentSize()
}
}
override var intrinsicContentSize: CGSize {
layoutIfNeeded()
return CGSize(width: UIView.noIntrinsicMetric, height: contentSize.height)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment