DevPrep

All topics › IDEs & SDK

Application launch sequence

Middle PRO

Before main (pre-main)

  1. The user taps the icon, the kernel creates the process and loads the binary.
  2. 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.
  3. The entry point runs. In a UIKit app it is @main on the AppDelegate (or an explicit UIApplicationMain), 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

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store