What's new in SwiftUI for iOS 18? I've written articles covering all the changes, big and small, and there's 30+ new Xcode projects of sample code ready to try! https://www.hackingwithswift.com/articles/270/whats-new-in-swiftui-for-ios-18
What’s new in SwiftUI for iOS 18

We got new API for colors and gradients, more scrollview improvements, tab improvements, and more.

Hacking with Swift

The biggest changes for me are:

- The TextRenderer protocol will unlock a ton of delight in app design
- ContactAccessButton makes privacy-friendly contact import a cinch
- Group(subviewsOf:) gives us so much power with subviews
- The Entry macro is genius
- MeshGradients are 💯

At the end I pick out a few things that are increasingly painful in their absence, including:

- Somehow we still have no WebView/SafariView
- The keychain remains hard to use and easy to screw up
- AsyncImageView desperately needs caching options
- Rich text in TextEditor

@twostraws I am really happy about TextEditor finally getting text selection support. I enjoy creating Document-based apps in SwiftUI. Especially on MacOS. Getting the code right for those apps still feels like rocket science, but every release since SwiftUI Release 4 has made it a lot easier, straightforward and a lot more stable 🙂
@Arcticulate Text selection is one of the things I'm holding back on until it stabilizes in a later seed; the API isn't quite there just yet.
@twostraws Ah, I see! Thank you, that’s good to know! I noticed the Xcode 16 beta 1 documentation provides rudimentary sample code on the topic. It was rather confusing, to be honest. Now I understand why 😌. I know it’s the first beta of Xcode 16, so I am not upset about it in any way. I’m just eager to start using it 😎
@twostraws couldn’t agree more on the Rich text in TextEditor! Markdown is excellent but not everyone knows how to use it nor has the inclination to learn. Bringing easier controls to enrich text is something missing at the moment. I wish there was a control light they’ve brought to Journal that kinda seems perfect
@twostraws having spent a great deal of time the last few months rewriting a text engine from TK1 to 2: I bet the rich text thing is a colossal pain in the ass.
@designatednerd Yes, I think that is by far the hardest. I guess they’d prefer to back on to UIKit/AppKit, but even that seems hard.
@twostraws I haven't loaded any of the betas yet. Are you seeing a preview there of the app integration with Apple Intelligence?
@twostraws the new stuff around traits on the Preview macro for working with SwiftData is an absolute god send! I’m really excited to play around with the ContactAcessButton in a few days too 😃