layout()
Perform layout in concert with the constraint-based layout system.
Declaration
func layout()Mentioned in
Discussion
Override this method if your custom view needs to perform custom layout not expressible using the constraint-based layout system. In this case you are responsible for setting needsLayout to true when something that impacts your custom layout changes.
You may not invalidate any constraints as part of your layout phase, nor invalidate the layout of your superview or views outside of your view hierarchy. You also may not invoke a drawing pass as part of layout.
You must call [super layout] as part of your implementation.
This method supports automatic observation tracking. For more information, see Updating views automatically with observation tracking.