Core Spotlight sample architecture
Source-backed, high-level architecture notes for Apple sample-code pages grouped in the Core Spotlight folder.
- Catalog module label:
Core Spotlight - Coverage: 1 / 1 sample pages documented
- Source policy: archive hashes and extracted-tree references are verified locally before analysis
Samples
| Sample | Platforms | High-level architecture | Documented patterns |
|---|---|---|---|
| Searching indexed content with natural language | iOS, iPadOS, Mac Catalyst | One SwiftUI app target. ContentView owns an @Observable SessionViewModel in @State. The view model builds a fresh SpotlightSearchTool and LanguageModelSession per search. A SpotlightIndexer singleton owns the named CSSearchableIndex, indexes the bundled plist, and acts as the index delegate that the tool also receives. |
Model-View-ViewModel, Observable state, Delegate or data-source callbacks, Singleton |
Cross-sample signals
Recurring documented patterns
| Pattern label | Sample documents |
|---|
Type-role naming evidence
Counts below are declaration-name suffixes, not inferred patterns.
| Role suffix | Distinct declarations across samples |
|---|---|
View |
5 |
App |
1 |
ViewModel |
1 |
Swift access-control evidence
These are declaration occurrences in scanned Swift source, including implicit internal declarations.
| Access level | Occurrences |
|---|---|
implicit internal |
82 |
private |
19 |
private(set) |
1 |
References
Generated from the verified local catalog and completed Markdown documents.