WebView, rich text editing for TextEditor, section index list titles, and more
Although the SwiftUI changes this year are a little smaller than we're used to, this year's SwiftUI update resolves a handful of common complaints folks hit when building – things that would pretty much always require us to drop down to UIKit can now be done natively, which is great.
This year the two biggest changes are:
- How to embed web content using
WebView - How to use rich-text editing with TextView and AttributedString
But in talking to developers, it's been interesting to see how smaller features are often more popular, usually because they finally resolve long-standing annoyances with SwiftUI:
- How to add list section index labels
- How to give label icons a fixed width
- How to automatically add appropriate padding for the current scene
- The
@Animatablemacro makes it easier to animate views, modifiers, and more - The
openURLaction has been extended to support an in-app browser
Once again we got a fantastic update from SF Symbols – the new draw on animations are thoroughly beautiul, particularly when used with things like checkboxes.
And there's also a bundle of updates specifically aimed at Apple's new liquid glass user interface, including:
- How to make a TabView minimize on scroll
- How to add a TabView accessory
- How to adjust the scroll edge effect for ScrollView and List
- We can now specify custom section spacing inside a list
- How to add space in a toolbar
- We can now set a navigation subtitle
The real work is down to developers who want to get a great liquid glass experience while also retaining compatibility with iOS 18 and earlier. My advice is not to rush: wait until at least beta 4 or perhaps even 5 before you start moving code across, so you have time to let the API settle a little and also to get used to how the effects look and feel.
What's still missing?
Every year folks including me ask the same question: what is still missing from SwiftUI after this year's update? Every year the list gets shorter, but there are still a few outstanding problems:
- Importing images from the camera
- Scanning QR codes and bar codes
- Cache control for
AsyncImageView - Making
@AppStoragesync with iCloud - Detecting shake gestures
- Reading and writing data with the keychain
It's also frustrating to see Apple ship all-new API without SwiftUI wrappers, with PaperKit being this year's primary offender.
As for SwiftData… well, it's not great news, let's put it that way.
Was this page useful? Let us know!
Average rating: 4.9/5
0 Comments
Log in to join the conversation.No comments yet. Be the first to share your thoughts.