how has swiftui changed since the 2021 release?
Generated on 8/8/2024
1 search
Since the 2021 release, SwiftUI has seen numerous enhancements and new features. Here are some of the key changes and improvements:
-
Interoperability with UIKit and AppKit:
- Gesture recognition has been factored out of UIKit, allowing built-in or custom UI gesture recognizers to be used in SwiftUI view hierarchies.
- Animations have been factored out of SwiftUI, enabling animations on UIKit or AppKit views to be driven by SwiftUI, including fully custom animations (Platforms State of the Union).
-
New Graphics Capabilities:
- A new mix modifier on color allows blending colors by a given amount.
- Extended custom shader features with precompilation to avoid frame drops caused by lazy shader compilation (What’s new in SwiftUI).
-
Scrolling Customizations:
- New APIs provide fine-grained control over scroll views, including reacting to changes in content offsets and sizes, detecting view visibility changes due to scrolling, and more programmatic control over scroll positions (What’s new in SwiftUI).
-
Xcode Previews Enhancements:
- A new dynamic linking architecture uses the same build artifacts for previews and builds, avoiding the need to rebuild projects when switching between the two.
- A new previewable macro allows the use of dynamic properties like state directly in an Xcode preview (Platforms State of the Union).
-
Customizations and New APIs:
- Custom hover effects for visionOS.
- New options to customize window behavior and styling in macOS.
- A new text renderer API for advanced visual effects and animations (Platforms State of the Union).
-
Swift 6 Language Mode:
- Enables compile-time data race safety.
- SwiftUI APIs have been improved to make it easier to adopt the new language mode (What’s new in SwiftUI).
-
Adoption and Use Cases:
- SwiftUI is now used extensively across Apple's platforms, including in apps like Xcode, Pages, Music, and core system experiences like Control Center and Notification Center.
- New apps and features built with SwiftUI include Image Playground and the new Passwords app (Platforms State of the Union).
These updates reflect a significant evolution in SwiftUI, making it more powerful, flexible, and easier to integrate with other frameworks and tools.
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.
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.