Centering subview’s X in autolayout throws “not prepared for the constraint”

For others who come here: I got this error, because I added the constraints before I added the subviews to the hierarchy.

Leave a Comment