are there changes in horizontal size class for modal UIKit controllers and SwiftUI view on iPad?
Asked on 09/22/2024
1 search
Yes, there are changes related to the horizontal size class for modal UIKit controllers and SwiftUI views on iPad. In iOS 18, UIKit introduces automatic trait tracking, which simplifies handling changes in traits like the horizontal size class. This means that when the horizontal size class changes, UIKit automatically updates the layout without the need for manual registration and handling, as described in the session What’s new in UIKit.
For SwiftUI, presentation sizing is now unified and simplified across platforms, allowing for more control over the size of modal presentations. This is discussed in the session What’s new in SwiftUI.

What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.

Work with windows in SwiftUI
Learn how to create great single and multi-window apps in visionOS, macOS, and iPadOS. Discover tools that let you programmatically open and close windows, adjust position and size, and even replace one window with another. We’ll also explore design principles for windows that help people use your app within their workflows.

Get started with Dynamic Type
Dynamic Type lets people choose their preferred text size across the system and all of their apps. To help you get started supporting Dynamic Type, we’ll cover the fundamentals: How it works, how to find issues with scaling text in your app, and how to take practical steps using SwiftUI and UIKit to create a great Dynamic Type experience. We’ll also show how you can best use the Large Content Viewer to make navigation controls accessible to everyone.