A placeholder is a generic preview of your widget shown
when the widget has no data yet — like when it's
first added to the home screen.
It is never shown with real data.
The system automatically blurs/redacts it.
Return something fast and hardcoded.
No network calls. No async. No logic.
Just a default entry.
func placeholder(in context: Context) -> SimpleEntry {
makeEntry(from: FocusState.all[0], index: 0, date: Date())
}
Always returns the first state (Focus / Deep Work)
Hardcoded → index 0, current date
No configuration read → intent is ignored here
1. Widget first added to home screen
2. Widget is loading / transitioning
3. WidgetKit doesn't have a valid snapshot yet
Your entry → system applies redaction
→ text becomes grey placeholder bars
→ colors are muted
→ user sees the shape/layout but not real content
Like this:
┌─────────────────┐
│ ▓▓▓▓▓ ▓▓▓▓ │ ← title + time redacted
│ │
│ ▓▓▓▓▓▓▓▓▓▓▓ │ ← value redacted
│ ▓▓▓▓▓▓ │ ← subtitle redacted
│ │
│ ▓▓▓▓▓▓▓▓▓▓▓▓ │ ← progress bar redacted
└─────────────────┘
Placeholder → no data yet, system redacts it
→ layout preview only
Snapshot → real data, shown in widget gallery
→ user sees actual content
Placeholder → "Here's the shape of my widget"
Snapshot → "Here's my widget with real data"
Timeline → "Here's my widget running live"
Never do heavy work in placeholder().
It must return instantly — it is synchronous,
not async like snapshot() and timeline().