malcommac / ScrollStackController

🧩 Easy scrollable layouts in UIKit - an UIStackView which scroll and uses root views of child view controllers.
MIT License
440 stars 38 forks source link

Cannot update the height of the ScrollStackRow's contentView because it does not receive scrollStackRowSizeForAxis() event when its layout di change #14

Closed malcommac closed 4 years ago

malcommac commented 4 years ago

Once placed the contentView (custom view or controller's view does not matter) for a ScrollStackRow cannot receive further scrollStackRowSizeForAxis() of the ScrollStackContainableController protocol and cannot correctly resize its content.

This is especially true when you need to make a row's height equal to the content of the inner UITableView instance evaluated using autolayout. If the contentView is placed the height is calculated with a wrong size which is the not the real size of the table placed but the table loaded initially from nib.

This fix allows to call this method when layoutSubviews of the row is called.

    open override func layoutSubviews() {
        super.layoutSubviews()

        askForCutomizedSizeOfContentView(animated: false)
    }