GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

What’s new in SwiftUI for iOS 17

This is another huge year of updates, delivering many highly requested features such as advanced scroll view effects, container relative sizing, and even Metal shaders.

Paul Hudson       @twostraws

SwiftUI continues to evolve at a rapid pace, and this year has seen a huge number of improvements to scroll views, fun new SF Symbols effects, advanced support for Metal shaders, and more.

Some of these are things I’ve asked for personally, including the ability to add Metal shaders, making Color work better with Codable, adding a completion closure for animations, allowing us to animate gradients, and being able to selectively round corners of a rectangle – I’ve closed at least a dozen feedbacks just from beta 1!

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure and A/B test your entire paywall UI without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

Scroll view improvements

Drawing and animation improvements

More welcome improvements

And there’s more…

You might expect me to talk about SwiftData here, but I’m not – or at least not yet. Yes, it’s important, and yes it’s genuinely a huge step forward for all iOS developers, but I’m spending a lot of time writing test projects, experimenting, and getting answers to my questions, because I want to be really sure I understand it thoroughly before I write about it.

However, there are other interesting SwiftUI changes to discuss:

And although it’s more of an Xcode improvement than a SwiftUI improvement, all images and colors defined in assets catalogs now have static names we can use in code rather than strings: Image(.dog) rather than Image("dog"), for example.

There are also new APIs for performing keyframe animations, new map controls, and more – I’m still digging in, writing code samples, and finding techniques that work well.

I particularly like some of the approaches taken in these new APIs, particularly the way things like scroll bar flashing, sensory feedback, and phase animations can be triggered using a simple Equatable comparison – it really lowers the complexity bar

So what about SwiftData?

The dramatic and wide-ranging changes to data management in SwiftUI are really welcome. In fact, there’s a video of me actually letting out a scream during Apple’s State of the Union session at Apple Park – I’m really glad to see it arrive.

However, it’s also something that takes care to get right. I’ll be updating my books for it – of course! – but I also want to make sure I understand the best practices for using it thoughtfully, so I hope you don’t mind a little delay while I’m conducting all my research.

Thank you for your patience!

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure and A/B test your entire paywall UI without any code changes or app updates.

Learn more here

Sponsor Hacking with Swift and reach the world's largest Swift community!

BUY OUR BOOKS
Buy Pro Swift Buy Pro SwiftUI Buy Swift Design Patterns Buy Testing Swift Buy Hacking with iOS Buy Swift Coding Challenges Buy Swift on Sundays Volume One Buy Server-Side Swift Buy Advanced iOS Volume One Buy Advanced iOS Volume Two Buy Advanced iOS Volume Three Buy Hacking with watchOS Buy Hacking with tvOS Buy Hacking with macOS Buy Dive Into SpriteKit Buy Swift in Sixty Seconds Buy Objective-C for Swift Developers Buy Beyond Code

Was this page useful? Let us know!

Average rating: 4.7/5

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.