WWDC 22’s Twitterati Roundup: Highlights From SwiftUI 4 for iOS 16 | by Anupam Chugh | Jul, 2022


Echoing the brand new options via tweets

Picture by Rubaitul Azad on Unsplash

Now that the euphoria of WWDC 22 has subsided, right here’s a have a look at a number of the finest tweets that can assist you get a pulse of most developer bulletins from the occasion.

Beginning iOS 16, we now have a Charts framework to simply create a Bar, Line, Space, Level, or Rule chart with customizable axis, and legends.

See find out how to annotate a PointMark SwiftUI chart with nearly any view — within the under case, utilizing SF Symbols:

For Linear gradients with the identical shade, you needn’t use the LinearGradient constructor anymore. Paul reveals find out how to invoke gradient on a shade to instantly deliver that impact to your views:

My favourite new SwiftUI function is the flexibility to export views as photos through the use of the ImageRenderer.

However are you aware find out how to match the view’s decision? Fortunately, there’s a scale property that you would be able to name on the ImageRenderer occasion as demonstrated within the under tweet by Daniel:

We are able to instantly set the editable checklist choices — like swipe to delete or reorder inside the brand new init operate’s edits argument:

A context menu with a preview that shows on prime of the menu? You’ve obtained it:

A built-in SF Symbols search inside Xcode 14 is a welcome addition. However the brand new variable shade function upons so many alternatives to show state-driven symbols…like a progress indicator as proven within the under tweet:

Out-of-the-box help for Grids would absolutely assist construct extra advanced layouts in SwiftUI. Just like the under tweet demonstrates (with gist pattern) reveals find out how to use Grids with SF Symbols and Timeline view.

To construct customized container views, SwiftUI has launched a Format protocol this 12 months. Right here’s one tweet exhibiting find out how to leverage it:

To dynamically change the kind of the format container with out recomposing its subviews, we’ve obtained a brand new AnyLayout struct:

Wish to create views which might be equally spaced radially? Right here’s a tweet that reveals find out how to use _CircleLayout — which is presently non-public.

Beforehand, Xcode would autocomplete argument labels of a operate/initializer even when it was already written — resulting in redundancy. Xcode 14 handles that extra effectively as demonstrated within the under tweet:

A LabeledContent view helps you to add a label to any view — with out going nested the HStackVStack manner. What’s extra? It’s good for accessibility too!

With iOS 16, SwiftUI has deprecated NavigationView in favor of NavigationStack. Additionally, there’s a NavigationPath to programmatically retailer and modify the route stack:

Moreover, it’s really easy to arrange deep hyperlinks and handoffs as showcased in Majid’s tweet.

Now you can faucet a view and get its location — world or native (native is relative to its tremendous view). Right here’s a helpful demonstration of the SpatialTapGesture for prototyping:

So as to add extra results to SwiftUI views, we will now leverage inside shadows like:

Circle().fill(.pink.gradient.shadow(.inside(radius: 10)))

Paul demonstrated find out how to use it alongside CoreMotion to deliver a 3D impact to your views:

That rounds up the heartbeat of SwiftUI Twitterati for WWDC 22. I can’t wait to see the superb apps we will construct utilizing the brand new options.



Leave a Comment