What's new in SwiftUI?
Generated on 7/16/2024
94 searches

This post is brought to you by Tailscan,
the best devtool for Tailwind CSS.
What's New in SwiftUI
SwiftUI has introduced a plethora of new features and improvements this year. Here are some of the highlights:
-
Graphics Capabilities:
- Color Mixing: A new
mix
modifier onColor
allows blending colors by a given amount. - Custom Shaders: Ability to precompile shaders before their first use to avoid frame drops caused by lazy shader compilation.
- Color Mixing: A new
-
Scroll View Enhancements:
- Fine-Grained Control: New APIs provide detailed control over scroll views, including reacting to changes in content, offsets, and content size.
- Visibility Detection: Detect when a view's visibility changes due to scrolling, enabling experiences like auto-playing videos when they come into view.
- Scroll Positions: More programmatic control over scroll positions, including scrolling to the top edge and turning off bouncing along a given axis.
-
Swift 6 Language Mode:
- Compile-Time Data Race Safety: The new Swift 6 language mode enables compile-time data race safety.
- Main Actor Annotation: Views in SwiftUI are now marked with the
@MainActor
annotation, meaning all types conforming toView
are implicitly isolated to the main actor by default.
-
Interoperability:
- Gesture Recognition: Gesture recognition has been factored out of UIKit, allowing the use of any built-in or custom UI gesture recognizer in SwiftUI view hierarchies.
- Animations: Animations have been factored out of SwiftUI, enabling the setup of animations on UIKit or AppKit views and driving them with SwiftUI, including fully custom animations.
-
Accessibility:
- Enhanced Labels: Add additional accessibility information to controls without overriding the framework-provided label.
- Conditional Modifier Support: New accessibility features such as conditional modifier support and app intent-based accessibility actions.
-
Xcode Previews:
- Dynamic Linking Architecture: Switch between a preview and build and run without needing to rebuild your project, increasing iteration speed.
- Previewable Macro: Use state directly in previews using the
@Previewable
macro, eliminating the boilerplate of wrapping your preview content in a view.
-
Text and Selection:
- Programmatic Text Selection: SwiftUI now offers programmatic access to and control of text selection within text editing controls.
For a detailed overview,

Platforms State of the Union
Discover the newest advancements on Apple platforms.

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 watchOS 11
Explore new opportunities on Apple Watch, including bringing Double Tap support to your watchOS app, making your Smart Stack widgets even more relevant and interactive, and displaying your iOS Live Activities in the Smart Stack.

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.