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.

New property wrappers in SwiftUI

SwiftUI allows us to declaratively build our user interfaces, while also indicating data dependencies for our views. We indicate these dependencies using data management types, which are implemented in SwiftUI as property wrappers such as State and Binding. With iOS 14, SwiftUI introduces additional property wrappers to help us manage state and data flow, and in this post, Majid shows us how we can use them.