SwiftUI’s New App Lifecycle and Replacements for AppDelegate and SceneDelegate in iOS 14

With iOS 14, it is now possible to build entire apps using only SwiftUI, avoiding the need to implement UIKit lifecycle protocols such as UIApplicationDelegate. This is made possible due to the introduction of new SwiftUI features such as the App protocol and SceneBuilder function builder. Here, Anupam Chugh shows us how we can leverage these new SwiftUI features to implement a SwiftUI app lifecycle.

A first look at matchedGeometryEffect

SwiftUI provides great support for animation, allowing us to animate changes to views, or to a view's state. In the latest version of SwiftUI, included in the iOS 14 beta, we get a new method, matchedGeometryEffect, which defines a group of views with synchronized geometry. Combining this method with SwiftUI's support for animations allows us to animate a change in the position and size of two or more views in our view hierarchy. In this post, Sarun shows us how it's done.

Adding optional @Bindings to SwiftUI views

SwiftUI gained a number of new view types at WWDC this year, one of them being DisclosureGroup. DisclosureGroup acts like an expandable cell, showing or hiding it's content based on it's disclosure state. One interesting aspect of this view is that it provides a number of initializers, some of which require an isExpanded binding, some of which don't. In other words, this isExpanded binding is optionally passed in when the view is initialized. In this post, Federico Zanetello shows us how we can add optional bindings to SwiftUI views, by creating his own version of the DisclosureGroup view.