I'm creating my constraints mainly in viewDidLoad
. In updateViewConstraints
I'm adding or removing some subviews and additionally adding and removing constraints. As a side note I'm using a container with child view controllers and I'm reusing the same view for different orientations (full in landscape, in a popover in portrait).
Because I have my complete setup in updateViewConstraints
I have to call it in some situations manually to adapt the visual changes and not to brake the constraints (e.g. when presenting the same view in a popover, or on iOS 7 it is not called on rotation). I also tried to use setNeedsUpdateConstraints
and so on but that always broke my constraints.
My question now is am I allowed to call updateViewConstraints
manually? Does it has some negative side effects? Or is the flow of my application wrong?