Foundation sample architecture
Source-backed, high-level architecture notes for Apple sample-code pages grouped in the Foundation folder.
- Catalog module label:
Foundation - Coverage: 8 / 8 sample pages documented
- Source policy: archive hashes and extracted-tree references are verified locally before analysis
Samples
| Sample | Platforms | High-level architecture | Documented patterns |
|---|---|---|---|
| Building a Localized Food-Ordering App | iOS, iPadOS, Mac Catalyst, watchOS | A Swift sample with the source-visible chain CaffeApp → ContentView → SwiftUI / ClockKit APIs. |
View-controller organization, Delegate or data-source callbacks, Binding-based state propagation |
| Building a resumable upload server with SwiftNIO | — | A Swift sample with the source-visible chain BaseClientCodec → HTTPResumableUploadHandler → FoundationNetworking APIs. |
— |
| Continuing User Activities with Handoff | iOS, iPadOS, Mac Catalyst, macOS | A Swift sample with the source-visible chain AppDelegate → MapViewController → AppleStore → MapKit / Cocoa APIs. |
View-controller organization, Delegate or data-source callbacks, Central store |
| Displaying Human-Friendly Content | iOS, iPadOS, Mac Catalyst, macOS | A Swift sample with the source-visible chain FormattersApp → ContentView → SwiftUI / AppKit APIs. |
— |
| Increasing App Usage with Suggestions Based on User Activities | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → DirectionsRequestViewController → MapKit / UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Language Introspector | iOS, iPadOS, Mac Catalyst, macOS | A Swift sample with the source-visible chain LanguageIntrospectorApp → ContentView → DateComponentsModel → SwiftUI / AppKit APIs. |
— |
| Synchronizing App Preferences with iCloud | iOS, iPadOS, Mac Catalyst, macOS | A Swift sample bundle with entry-bearing project variants PrefsInCloud_iOS, PrefsInCloud_macOS, each leading to UIKit / Cocoa APIs. |
View-controller organization, Delegate or data-source callbacks |
| Using JSON with custom types | — | A Swift sample with the source-visible chain GroceryStore → GroceryStoreService → Foundation APIs. |
Service object, Central store |
Cross-sample signals
Recurring documented patterns
| Pattern label | Sample documents |
|---|---|
| View-controller organization | 4 |
| Delegate or data-source callbacks | 4 |
| Central store | 2 |
Type-role naming evidence
Counts below are declaration-name suffixes, not inferred patterns.
| Role suffix | Distinct declarations across samples |
|---|---|
View |
31 |
Controller |
9 |
Model |
8 |
App |
4 |
Delegate |
3 |
Store |
2 |
Handler |
1 |
Recorder |
1 |
Service |
1 |
Swift access-control evidence
These are declaration occurrences in scanned Swift source, including implicit internal declarations.
| Access level | Occurrences |
|---|---|
implicit internal |
1138 |
public |
283 |
private |
187 |
fileprivate |
5 |
internal |
2 |
private(set) |
1 |
References
Generated from the verified local catalog and completed Markdown documents.