SwiftUI
Declare the user interface and behavior for your app on every platform.
Overview
SwiftUI provides views, controls, and layout structures for declaring your app’s user interface. The framework provides event handlers for delivering taps, gestures, and other types of input to your app, and tools to manage the flow of data from your app’s models down to the views and controls that users see and interact with.
Define your app structure using the App protocol, and populate it with scenes that contain the views that make up your app’s user interface. Create your own custom views that conform to the View protocol, and compose them with SwiftUI views for displaying text, images, and custom shapes using stacks, lists, and more. Apply powerful modifiers to built-in views and your own views to customize their rendering and interactivity. Share code between apps on multiple platforms with views and controls that adapt to their context and presentation.
[Image]
You can integrate SwiftUI views with objects from the UIKit, AppKit, and WatchKit frameworks to take further advantage of platform-specific functionality. You can also customize accessibility support in SwiftUI, and localize your app’s interface for different languages, countries, or cultural regions.
Featured samples
Topics
Essentials
App structure
App organizationScenesWindowsImmersive spacesDocumentsNavigationModal presentationsToolbarsSearchApp extensions
Data and storage
Views
View fundamentalsView configurationView stylesAnimationsText input and outputImagesControls and indicatorsMenus and commandsShapesDrawing and graphics
View layout
Event handling
Accessibility
Accessibility fundamentalsAccessible appearanceAccessible controlsAccessible descriptionsAccessible navigation