Application launch sequence
Before main (pre-main)
- The user taps the icon, the kernel creates the process and loads the binary.
- dyld loads dynamic libraries (system ones from the shared cache — fast; frameworks embedded in the app — each costs time), binds symbols, runs static initializers and ObjC
+load. - The entry point runs. In a UIKit app it is
@mainon theAppDelegate(or an explicitUIApplicationMain), in SwiftUI —@main struct MyApp: App.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep