UIKit sample architecture
Source-backed, high-level architecture notes for Apple sample-code pages grouped in the UIKit folder.
- Catalog module label:
UIKit - Coverage: 48 / 48 sample pages documented
- Source policy: archive hashes and extracted-tree references are verified locally before analysis
Samples
| Sample | Platforms | High-level architecture | Documented patterns |
|---|---|---|---|
| Add Home Screen quick actions | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ContactDetailViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Adding context menus in your app | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → BaseCollectionViewTestViewController → DetailViewManager → CollectionViewPreviewProvider → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Adding hardware keyboard support to your app | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → AddShapeViewController → FileStore → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks, Central store |
| Adding menus and shortcuts to the menu bar and user interface | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → MenuController → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Adjusting your layout with keyboard layout guide | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Adopting drag and drop in a custom view | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Adopting drag and drop in a table view | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → TableViewController → Model → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Adopting hover support for Apple Pencil | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Adopting iOS Dark Mode | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → After2MoreViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Adopting menus and UIActions in your user interface | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → BarButtonItemDemoViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Asynchronously loading images into table and collection views | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → CollectionViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Building a document browser app for custom file formats | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → DocumentBrowserViewController → Document → ThumbnailProvider → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Building an app with a document browser | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → DocumentBrowserViewController → TextDocument → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Building and improving your app with Mac Catalyst | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → BrowserSplitViewController → DetailToolbarModel → ItemPrintPageRenderer → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Building high-performance lists and collection views | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → PostGridViewController → AnyModelStore → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks, Central store |
| Changing the appearance of selected and highlighted cells | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Creating self-sizing table view cells | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Customizing an image picker controller | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → APLViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Customizing and resizing sheets in UIKit | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → SettingsViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Customizing collection view layouts | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → FeedViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Customizing your app’s navigation bar | iOS, iPadOS, Mac Catalyst, macOS, tvOS, visionOS, watchOS | A Swift sample with the source-visible chain AppDelegate → CustomBackButtonDetailViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Data delivery with drag and drop | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ContactDetailsViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Detecting changes in the preferences window | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Disabling the pull-down gesture for a sheet | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → EditViewController → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Display text with a custom layout | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → BaseViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Displaying searchable content by using a search controller | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → DetailViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Enhancing your iPad app with pointer interactions | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ThreadPickerViewController → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Enriching your text in text views | iOS, iPadOS, Mac Catalyst, macOS, visionOS | A Swift sample with the source-visible chain TextKitAndTextViewSampleApp → ContentView → AnimatedAttachmentViewProvider → SwiftUI / AVKit APIs. |
Delegate or data-source callbacks |
| Illustrating the force, altitude, and azimuth properties of touch input | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Implementing modern collection views | iOS, iPadOS, Mac Catalyst, macOS | A Swift sample bundle with entry-bearing project variants Modern Collection Views Mac, Modern Collection Views, each leading to UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Implementing Peek and Pop | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ColorItemViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Integrating pointer interactions into your iPad app | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Leveraging touch input for drawing apps | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → CanvasMainViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Navigating an app’s user interface using a keyboard | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → DescriptionPopoverViewController → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Prefetching collection view data | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → Model → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Restoring your app’s state | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → CollectionViewController → DataModelManager → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Selecting multiple items with a two-finger pan gesture | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → CollectionViewController → FillerModel → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Showing help tags for views and controls using tooltip interactions | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Supporting desktop-class features in your iPad app | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → DocumentBrowserViewController → MarkdownDocument → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Supporting gesture interaction in your apps | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Supporting HDR images in your app | iOS, iPadOS, Mac Catalyst, macOS | A Swift sample with the source-visible chain HDRDemo23App → MainView → Renderer → SwiftUI / CoreImage APIs. |
Binding-based state propagation |
| Supporting multiple windows on iPad | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → GalleryViewController → PhotoManager → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Synchronizing documents in the iCloud environment | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → DetailViewController → Document → MetadataProvider → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| UIKit Catalog: Creating and customizing views and controls | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → ActivityIndicatorViewController → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
| Updating collection views using diffable data sources | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → RecipeDetailViewController → DataStore → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks, Central store |
| Using suggested searches with a search controller | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → DetailViewController → UIKit APIs. |
View-controller organization, Protocol-oriented abstraction, Delegate or data-source callbacks |
| Using SwiftUI with UIKit | iOS, iPadOS, Mac Catalyst | A Swift sample with the source-visible chain AppDelegate → HostingConfigurationViewController → DataStore → UIKit APIs. |
View-controller organization, Delegate or data-source callbacks, Central store, Publisher-backed observable state |
| Using TextKit 2 to interact with text | iOS, iPadOS, Mac Catalyst, macOS | A Swift sample bundle with entry-bearing project variants iOS, macOS, each leading to UIKit APIs. |
View-controller organization, Delegate or data-source callbacks |
Cross-sample signals
Recurring documented patterns
| Pattern label | Sample documents |
|---|---|
| Delegate or data-source callbacks | 47 |
| View-controller organization | 46 |
| Protocol-oriented abstraction | 14 |
| Central store | 4 |
Type-role naming evidence
Counts below are declaration-name suffixes, not inferred patterns.
| Role suffix | Distinct declarations across samples |
|---|---|
Controller |
206 |
Delegate |
93 |
View |
73 |
Model |
10 |
Provider |
9 |
Store |
8 |
Document |
6 |
DataSource |
5 |
Manager |
3 |
Renderer |
2 |
App |
2 |
Transformer |
1 |
Operation |
1 |
Component |
1 |
Swift access-control evidence
These are declaration occurrences in scanned Swift source, including implicit internal declarations.
| Access level | Occurrences |
|---|---|
implicit internal |
7830 |
private |
751 |
fileprivate |
61 |
public |
29 |
private(set) |
9 |
References
Generated from the verified local catalog and completed Markdown documents.