fix update constraints

This commit is contained in:
Pfeil, Scott Robert 2020-04-22 14:08:45 -04:00
parent 02e1de9b88
commit ca389567cc
3 changed files with 12 additions and 6 deletions

View File

@ -44,9 +44,9 @@ open class ScrollingViewController: ViewController {
}
open override func updateViewConstraints() {
super.updateViewConstraints()
// Sets the width of the content to the width of the screen.
contentWidthConstraint?.constant = view.bounds.width - scrollView.contentInset.left - scrollView.contentInset.right
super.updateViewConstraints()
}
open override func viewDidLayoutSubviews() {

View File

@ -67,9 +67,10 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
}
open override func updateViewConstraints() {
super.updateViewConstraints()
guard let tableView = tableView else { return }
guard let tableView = tableView else {
super.updateViewConstraints()
return
}
let minimumSpace: CGFloat = minimumFillSpace()
var currentSpace: CGFloat = 0
@ -89,7 +90,10 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
totalMinimumSpace += minimumSpace
}
guard fillTop || fillBottom else { return }
guard fillTop || fillBottom else {
super.updateViewConstraints()
return
}
let newSpace = MVMCoreUIUtility.getVariableConstraintHeight(currentSpace, in: tableView, minimumHeight: totalMinimumSpace)
let width = view.bounds.width
@ -110,6 +114,7 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
showFooter(width)
}
}
super.updateViewConstraints()
}
//MARK: - Header Footer

View File

@ -42,8 +42,8 @@ open class ThreeLayerViewController: ProgrammaticScrollViewController {
}
open override func updateViewConstraints() {
super.updateViewConstraints()
guard let scrollView = scrollView else {
super.updateViewConstraints()
return
}
@ -52,6 +52,7 @@ open class ThreeLayerViewController: ProgrammaticScrollViewController {
} else {
heightConstraint?.constant = -scrollView.contentInset.top - scrollView.contentInset.bottom
}
super.updateViewConstraints()
}
open override func loadView() {