View Layout and Presentation
Combine views in stacks, generate groups and lists of views dynamically, and define view presentations and hierarchy.
Use stacks and lists to lay out the views of your user interface. You can combine static views with views that are dynamically generated from collections of data. All container views update and adjust the positions of their children in response to changes in content or interface dimensions.
Building Lists and Navigation
With the basic landmark detail view set up, you need to provide a way for users to see the full list of landmarks, and to view the details about each location.
Composing Complex Interfaces
The home screen for Landmarks shows a scrolling list of categories, with horizontally scrolling landmarks within each category. As you build this primary navigation, you’ll explore how composed views can adapt to different device sizes and orientations.
A view that arranges its children in a horizontal line.
A view that arranges its children in a vertical line.
A view that overlays its children, aligning them in both axes.
Lists and Scroll Views
A container that presents rows of data arranged in a single column.
The collection of underlying identified data that SwiftUI uses to create views dynamically.
The horizontal or vertical dimension in a 2D coordinate system.
A container for grouping controls used for data entry, such as in settings or inspectors.
A stylized view with an optional label that is associated with a logical grouping of content.
Spacers and Dividers
A flexible space that expands along the major axis of its containing stack layout, or on both axes if not contained in a stack.
A visual element that can be used to separate other content.
A view for presenting a stack of views representing a visible path in a navigation hierarchy.
A view that switches between multiple child views using interactive user interface elements.
A layout container that arranges its children in a horizontal line and allows the user to resize them using dividers placed between them.
A layout container that arranges its children in a vertical line and allows the user to resize them using dividers placed between them.
Conditionally Visible Items
A view type that compares itself against its previous value and prevents its child updating if its new value is the same as its old value.
Drawing and Animation
Enhance your views with colors, shapes, and shadows, and customize animated transitions between view states.
Integrate SwiftUI views into existing apps, and embed AppKit, UIKit, and WatchKit views and controllers into SwiftUI view hierarchies.