updateProperties

Asked on 06/17/2025

2 searches

The updateProperties method is a new addition to UIKit, introduced to enhance the way views are updated. It is designed to work alongside the existing layoutSubviews method, providing a more efficient way to update properties without forcing a layout pass. This method is particularly useful for populating content, applying styling, or configuring behaviors, and it automatically tracks any observable you read. You can also manually trigger it by calling setNeedsUpdateProperties.

The updateProperties method runs just before layoutSubviews but is independent of it, allowing you to invalidate properties without forcing a layout and vice versa. This helps avoid extra passes and allows for finer-grained updates. It is part of the architectural improvements in UIKit, as discussed in the session What’s new in UIKit.