If you have updated your views and the Autolayout constraints are not updating, you can try the following solutions:
layoutIfNeeded()
on the view. This forces the layout engine to update the constraints and relayout the view hierarchy.main.swift44 chars3 lines
layoutIfNeeded()
on the view controller's view first. This ensures that the view hierarchy is initialized before the constraints are updated.main.swift54 chars3 lines
Make sure the constraints are set up correctly. Check that the constraints are not conflicting or ambiguous. Use the Xcode debugger to see the layout errors.
If you are using Autolayout in a custom view, make sure to override the intrinsicContentSize
method to return the correct size.
main.swift89 chars4 lines
main.swift105 chars4 lines
gistlibby LogSnag