what are the latest changes in swiftui
Generated on 10/17/2024
1 search
Here are the latest changes in SwiftUI as presented at WWDC 2024:
-
Graphics Capabilities: SwiftUI now includes a new mix modifier on colors, allowing you to blend colors by a specified amount. Additionally, custom shaders can be precompiled to avoid frame drops caused by lazy shader compilation.
-
Scroll View Enhancements: There are new APIs for more granular control over scroll views. You can react to changes in content, offsets, and content size with
onScrollGeometryChange
. You can also detect when a view's visibility changes due to scrolling, enabling experiences like auto-playing videos. -
Swift 6 Language Mode: SwiftUI has improved its APIs to facilitate the adoption of the new Swift 6 language mode, which includes compile-time data race safety. Views in SwiftUI are now marked with the main actor annotation, meaning they are implicitly isolated to the main actor by default.
-
Interoperability Improvements: Significant improvements have been made to the integration of gestures and animations between SwiftUI and UIKit/AppKit. You can now use any built-in or custom UI gesture recognizer in your SwiftUI view hierarchy, and animations can be set up on UIKit or AppKit views and driven with SwiftUI.
-
Accessibility Enhancements: SwiftUI now allows adding additional accessibility information to controls without overriding the framework-provided label. There are also new accessibility features like conditional modifier support and app intent-based accessibility actions.
-
Xcode Previews: A new dynamic linking architecture in Xcode previews allows switching between a preview and build without needing to rebuild the project, increasing iteration speed. You can also use state directly in previews using the
@Previewable
macro.
For more detailed information, you can refer to the session What’s new in SwiftUI (16:18) which covers scrolling enhancements and other updates.
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.
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.
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.
Platforms State of the Union
Discover the newest advancements on Apple platforms.
Migrate your TVML app to SwiftUI
SwiftUI helps you build great apps on all Apple platforms and is the preferred toolkit for bringing your content into the living room with tvOS 18. Learn how to use SwiftUI to create familiar layouts and controls from TVMLKit, and get tips and best practices.