What’s New in SwiftUI iOS 16.4

A quick tour on the news introduced in SwiftUI by iOS 16.4

Alessandro Manilii


Photo by mali maeder: https://www.pexels.com/it-it/foto/uomo-che-legge-un-giornale-902194/

Apple just released iOS 16.4 to the developers and this release brings us small but welcome new features for our beloved SwiftUI. A lot of them are for the Sheet component, other will probably change our way to approach with older iOS versions…

With this article I will show you them.

Prints on Previews

It’s finally possible to use the print command on previews without the need to run the app on a simulator. Super handy for a fast debug!

Just show the debug area in Xcode and everything will work like a charm:

Scroll Bounce Behavior

In my past apps in UIKit, a common request from my customers was to limit the bounce of a tableView only if its content was bigger than the screen itself. I wrote a small extension to do that… finally SwiftUI has the same behavior too! Just use the modifier scrollBounceBehavior(.basedOnSize):

Sheet Presentation Background

Sheets! Well… we use them, don’t we? 😁

This modifier allows us to easily apply a style for a presented sheet… this is one thing I’ll use a lot since I really like the glass-like effect given by the SwiftUI materials. Just use .presentationStyle(_) on the sheet view itself and the magic is done:

Sheet Presentation Background Interaction



Alessandro Manilii

I’m an Italian professional iOS Developer, iOS Tech Lead at Wakala — Join Medium from the following link: https://medium.com/@alessandromanilii/membership