What is new in SwiftUI for iOS 17 and 18?
Asked on 08/06/2024
1 search
What's New in SwiftUI for iOS 17 and 18
iOS 17
For iOS 17, SwiftUI introduced several new features and improvements:
- Graphics Capabilities: New mix modifier on color to blend colors by a given amount.
- Custom Shader Feature: Ability to precompile shaders before their first use to avoid frame drops.
- Scroll View Enhancements:
- Fine-grained control over scroll views.
- New
onScrollGeometryChange
to react to changes in content, offsets, and content size. - Detecting view visibility changes due to scrolling.
- More programmatic control over scroll positions and content alignment.
- Swift 6 Language Mode:
- Compile-time data race safety.
- Views in SwiftUI are now marked with the
@MainActor
annotation by default.
For more details, you can refer to the session What’s new in SwiftUI (16:47).
iOS 18
For iOS 18, SwiftUI continued to evolve with additional features:
- TabView Enhancements:
- New syntax to catch common errors at build time.
- Declaration of a tab struct with title, image, and content view.
- Programmatic selection of tabs.
- Interoperability with UIKit:
- Gesture recognition factored out of UIKit, enabling use in SwiftUI view hierarchy.
- Animations factored out of SwiftUI, allowing setup on UIKit or AppKit views and driven by SwiftUI.
- Custom Containers and Mesh Gradients:
- New custom containers and mesh gradients for more flexible UI designs.
- Scrolling Customizations:
- Additional knobs for perfecting the scrolling experience, such as turning off bouncing along a given axis and programmatically stopping scrolling.
For more details, you can refer to the session What’s new in SwiftUI (00:07).
Relevant Sessions
These sessions provide a comprehensive overview of the new features and improvements in SwiftUI for iOS 17 and 18.

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.

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

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.