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.