Launch Module

← App map · The splash while the database migrates, the seven-step first-run onboarding, and the five-tab shell every other screen lives in.

Screenshots scroll sideways · tap to enlarge

What it does

SceneDelegate creates the window and calls launchApp(in:waitToResumeApp:) on the single WMFAppViewController. It covers itself with SplashScreenViewController (the launch-screen wordmark), then waits for MWKDataStore to finish its Core Data setup and library updates; if a migration is needed and takes longer than 4 s, the splash cross-fades over 0.3 s into a loading animation. When the data is ready, setupControllers() starts the background workers and resumeApp decides what to show. On the very first launch (no WMFDidShowOnboarding flag, and not opened from a link that skips it) AppOnboardingCoordinator presents a SwiftUI flow of seven steps: intro, data & privacy, languages (the device's languages, with an editor), a personalization intro, interests, feed preference (which Home segment to see first), and a loading step that builds the Home feed — it waits for the feed for at most 8 s and shows the animation for at least one 1 s loop. The last three steps show page dots and Skip, which keeps the default feed preference. Whatever path it takes, the app then builds five tabs — Home, Places, Saved, Activity, Search — each in its own navigation controller, and reopens on Home if it was in the background for 24 hours or more (unless the reader chose to open on Search).

Logic class diagram

The tab bar controller is also the app coordinator: it owns the data store, the splash, the onboarding and the tab roots.

Onboarding state machine

advance() moves one step; skip() (shown on the personalization steps) and the end of loading both finish.

First launch sequence

The splash stays up until the store is ready; onboarding replaces it, and the tabs load behind it.

Key files