Skip to content

Latest commit

 

History

History
17 lines (10 loc) · 772 Bytes

File metadata and controls

17 lines (10 loc) · 772 Bytes

Example - setNeedsLayout vs layoutIfNeeded vs layoutSubviews()

Summary :

layoutIfNeeded is a synchronous call that will let the system update the views and force the layout engine to redraw the views. setNeedsLayout is a deferred call and asynchronous call that will mark the layout has changed but it will call layoutSubViews() in the next cycle. Both layoutIfNeeded and setNeedsLayout call layoutSubViews()

Screenshots :

setNeedsLayout Example

layoutIfNeeded Example