Called when the iOS interface environment changes.
- iOS 8.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
UITraitobject before the interface environment changed.
The system calls this method when the iOS interface environment changes. Implement this method in view controllers and views, according to your app’s needs, to respond to such changes. For example, you might adjust the layout of the subviews of a view controller when an iPhone is rotated from portrait to landscape orientation. The default implementation of this method is empty.
At the beginning of your implementation, call
super to ensure that interface elements higher in the view hierarchy have an opportunity to adjust their layout first. Use code similar to this: