what's new with display classes?

Generated on 8/3/2024

1 search

In the session What’s new in UIKit, Apple introduced automatic trait tracking in iOS 18. This feature simplifies the process of handling display classes by automatically updating views when traits such as the horizontal size class change. Previously, developers had to manually register for trait changes and call setNeedsLayout on views. With automatic trait tracking, this manual process is eliminated, and the system automatically updates the views, ensuring maximum performance by only creating necessary trait dependencies.

For more details, you can refer to the chapter on Automatic trait tracking in the "What’s new in UIKit" session.