What Changed in SwiftUI
Asked on 2024-07-30
1 search
Changes in SwiftUI
New Graphics Capabilities
- Color Mixing: A new
mixmodifier onColorallows blending colors by a given amount. - Custom Shaders: Extended custom shader feature with precompilation to avoid frame drops.
Scrolling Enhancements
- Fine-Grained Control: New APIs for better control over scroll views.
- On Scroll Geometry Change: React to changes in content, offsets, and content size.
- Visibility Detection: Detect when a view's visibility changes due to scrolling.
- Programmatic Control: More scroll positions to programmatically scroll to, like the top edge.
- Additional Customizations: Options to turn off bouncing along a given axis, programmatically stop scrolling, and control content alignment.
Swift 6 Language Mode
- Compile-Time Data Race Safety: New language mode for safer code.
- Main Actor Annotation: Views in SwiftUI are now marked with the main actor annotation, isolating them to the main actor by default.
Accessibility Improvements
- Accessibility Labels: Add additional accessibility information without overriding the framework-provided label.
- Conditional Modifier Support: New accessibility features like conditional modifier support and app intent-based accessibility actions.
Xcode Previews
- Dynamic Linking Architecture: Switch between preview and build without rebuilding the project.
- Previewable Macro: Use state directly in previews, reducing boilerplate code.
Text and Selection Management
- Text Selection: Programmatic access to and control of text selection within text editing controls.
Interoperability with UIKit and AppKit
- Gesture and Animation Integration: Use built-in or custom UI gesture recognizers in SwiftUI view hierarchy.
- Animation Setup: Set up animations on UIKit or AppKit views and drive them with SwiftUI.
Customizations and New APIs
- Custom Containers: New options for creating custom containers.
- Mesh Gradients: New gradient options for more complex visual effects.
- Text Renderer API: Enables advanced visual effects and animations.
For a detailed overview, you can watch the session What’s new in SwiftUI starting at 14:17.

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.

What’s new in UIKit
Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.

Get started with HealthKit in visionOS
Discover how to use HealthKit to create experiences that take full advantage of the spatial canvas. Learn the capabilities of HealthKit on the platform, find out how to bring an existing iPadOS app to visionOS, and explore the special considerations governing HealthKit during a Guest User session. You’ll also learn ways to use SwiftUI, Swift Charts, and Swift concurrency to craft innovative experiences with HealthKit.
