What is new on SwiftUI for IOS 18?
Asked on 08/05/2024
1 search
In iOS 18, SwiftUI introduces several new features and improvements:
-
Graphics Capabilities:
- New mix modifier on color to blend colors by a given amount.
- Extended custom shader feature with precompilation to avoid frame drops.
-
Scroll View Enhancements:
- Fine-grained control over scroll views with
onScrollGeometryChange
. - Ability to detect view visibility changes due to scrolling.
- More programmatic control over scroll positions and content alignment.
- Fine-grained control over scroll views with
-
New TabView Syntax:
- Easier to catch common errors at build time.
- New syntax to declare a tab struct with title, image, and content view.
- Programmatic selection of tabs.
-
Swift 6 Language Mode:
- Compile-time data race safety.
- Views in SwiftUI are now marked with the main actor annotation.
-
Custom Containers and Mesh Gradients:
- New APIs for custom containers.
- Beautiful mesh gradients for more visually appealing designs.
-
Improved Interoperability:
- Gesture recognition factored out of UIKit for use in SwiftUI.
- Animations can be set up on UIKit or AppKit views and driven by SwiftUI.
-
Xcode Previews:
- New dynamic linking architecture for smoother workflow.
- Previewable macro to use dynamic properties like state directly in previews.
For more details, you can check out the session "What’s new in SwiftUI" (00:00:07).
Relevant Sessions

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.

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

Elevate your tab and sidebar experience in iPadOS
iPadOS 18 introduces a new navigation system that gives people the flexibility to choose between using a tab bar or sidebar. The newly redesigned tab bar provides more space for content and other functionality. Learn how to use SwiftUI and UIKit to enable customization features – like adding, removing and reordering tabs – to enable a more personal touch in your app.