Managing app in SwiftUI

Swift 5.3 introduces the @main attribute, used to designate a type as the entry point for program execution. Combining this feature with the new App and Scene protocols from SwiftUI allows us to manage an app's lifecycle with minimal code, without needing to rely on UIKit types such as UIApplicationDelegate. In this post, Majid Jabrayilov shows us how to implement common app lifecycle events using these new features.

A deep dive into Swift’s function builders

Despite not yet being an officially released language feature, Swift's function builders power SwiftUI's DSL-like API and is one of the more interesting recent additions to the language. In this deep dive, John Sundell takes a closer look at function builders, providing insights into the feature by implementing a function builder for a settings API. Like John, I hope the function builders feature goes through the Swift Evolution process sooner rather than later.

Entry Points in Swift: How @main and @UIApplicationMain work internally

When creating Swift command-line programs, the Swift compiler automatically generates the main C function, which is used as the program's entry point. On iOS, where the entry point needs to be more tightly controlled, Swift provides attributes that can be used to designate an app's entry point. In this post, Bruno Rocha looks at how Swift determines the entry point of an app and explains how the attributes available in iOS work internally.