WWDC 2022: What's new in SwiftUI

Find hereafter a detailed summary of the above named video which belongs to a taxonomy of some WWDC footages.

The original video is available on the official Apple website (session 10052).

"Join us as we share the latest updates and a glimpse into the future of UI framework design. Discover deep levels of customization, advanced techniques for layout, elegant strategies for sharing, and rock-solid structural approaches for designing an app top-to-bottom in SwiftUI. We'll also have some celebratory fun as we play with the latest graphical effects and explore APIs."


The outlines of this speech are indicated hereunder:


Most of the illustrations are parts of the Apple presentations and may be available at the Resources section inside the Overview sheet of each video.

Hereafter, the underlined elements lead directly to the playback of the WWDC video at the appropriate moment.

Swift Charts #

The Swift Charts framework guarantees the basic creation of a chart thanks to few lines of code that only demand data and a dedicated model as incoming parameters.

The various chart models may lead to many customizable elements that enhance the user experience.

Many features like Dark Mode, localization or Dynamic Type are also taken into account by this framework.

SwiftUI introduces updates in iOS 16 for three common app navigation patterns.

🎬

The NavigationView structure is deprecated in iOS 16 so as to give way to the brand new NavigationStack.

The things to remember about this new navigation element are twofold:

  1. The new close binding between the navigation destinations and the data types brings about a finer control of the navigation stack's state thanks to the navigationDestination modifier.
  2. The NavigationLink structure can now take a value type as incoming parameter instead of a destination view.

This new way of using navigation allows to get the current navigation path as explicit state.

🎬

The new NavigationSplitView structure aims at presenting views in two or three columns through a navigation pattern...

... and is perfectly adapted for the multiplatform apps that may require a reorganization of the available screen space.

🎬

Besides the WindowGroup already embraced in SwiftUI, there's a new Window scene in iOS 16 to present the content in a single window that can be reached thanks to the app's window menu or a shortcut.

The opening of this window including its position and size is completely handled by code.

Bars can also be added to the menu either as an app feature or as the app itself.


Advanced controls #

A new visual style is outlined from System Settings that may bring about some rearrangements of controls to better meet this design in the apps as well on macOS as on iOS.

Controls #

  1. The multiline Textfield can be scrollable thanks to an enhanced linelimit modifier⟹ 🎬

  2. The new MultiDataPicker handles the multi selections on non adjacent elements⟹ 🎬

  3. The mixed-state controls adapt the results of selections on grouped items⟹ 🎬

  4. The button style composition is an effective way to highlight some elements⟹ 🎬

  5. The stepper can now display a formatted value⟹ 🎬

  6. The new accessibilityQuickAction improves the user experience with less gestures⟹ 🎬


Tables #

🎬

Tables are part of iPadOS and iOS apps now but with a different rendering due to the available width of the display.

🎬

Actions are accessible in a menu according to the selected element including a possible multi items selection.

🎬

To improve the user experience and refine the requests, the SearchBar includes potential customizable tokens...

... and possible scopes that adapt to the available display of the device.


Sharing #

Three different domains are highligted to easily share contents with others and data across applications.

🎬

The new PhotosPicker generic structure provides a view for choosing assets from the photo library.

🎬

This new structure aims at controlling a sharing presentation.

This view may be also part of a context menu for a better user experience.

🎬

This new protocol describes how types are transferred across applications such as drag and drop or copy/paste.

Many standard types already conform to this protocol that can be readily implemented in some custom types.


Graphics and layout #

  1. Color has a new gradient property⟹ 🎬

  2. The ShapeStyle protocol incorporates a new shadow modifier⟹ 🎬

  3. Xcode 14 provides a preview variants feature that now runs in live mode by default⟹ 🎬

  4. The usual SwiftUI animation APIs can be used for Text⟹ 🎬

  5. There's a new Grid container view that organizes other views in a two dimensional layout⟹ 🎬



  1. And last but not least, the new Layout protocol permits the customization for the geometry of a collection of views.