페이지

2021년 7월 1일 목요일

When custom view autolayout doesn't work correclty

if updateLayout() is called in another methods except layoutSubivews(),

view's autolayout doesn't work appropriately.

i don't know why ...

class MyView:UIView {

    override func layoutSubviews() {

        super.layoutSubviews()

        updateLayout()

    }

    func updateLayout(){

        // setting height, constraints

    }

}