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() { open override func updateViewConstraints() {
super.updateViewConstraints()
// Sets the width of the content to the width of the screen. // Sets the width of the content to the width of the screen.
contentWidthConstraint?.constant = view.bounds.width - scrollView.contentInset.left - scrollView.contentInset.right contentWidthConstraint?.constant = view.bounds.width - scrollView.contentInset.left - scrollView.contentInset.right
super.updateViewConstraints()
} }
open override func viewDidLayoutSubviews() { open override func viewDidLayoutSubviews() {

View File

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

View File

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