Views and controls are the visual building blocks of your app’s user interface. Use them to present your app’s content onscreen. Views represent text, images, shapes, custom drawings, and compositions of any and all of these together. Controls enable user interaction with consistent APIs that adapt to their platform and context.
Combine views using containers that specify their visual relationships and hierarchy. Use methods called modifiers to customize the display, behavior, and interactivity of built-in views and those you create for your app.
You apply modifiers to views and controls to:
Control the size, position, and appearance attributes of the view.
Respond to taps, gestures, and other user interactions.
Support drag and drop operations.
Customize animations and transitions.
Set style preferences and other environment data.
For additional information about how to use views and controls, see Human Interface Guidelines.
A type that represents a SwiftUI view.
Creating and Combining Views
This tutorial guides you through building Landmarks — an iOS app for discovering and sharing the places you love. You’ll start by building the view that shows a landmark’s details.
Working with UI Controls
In the Landmarks app, users can create a profile to express their personality. To give users the ability to change their profile, you’ll add an edit mode and design the preferences screen.
A view that displays one or more lines of read-only text.
A control that displays an editable text interface.
A control into which the user securely enters private text.
An environment-dependent font.
A view that displays an environment-dependent image.
A control that performs an action when triggered.
A button that triggers a navigation presentation when pressed.
A button that displays a menu containing a list of choices when pressed.
A button that toggles the edit mode for the current edit scope.
A system button that triggers reading data from the pasteboard.
A control that toggles between on and off states.
A control for selecting from a set of mutually exclusive values.
A control for selecting an absolute date.
A control for selecting a value from a bounded linear range of values.
A control used to perform semantic increment and decrement actions.
A custom parameter attribute that constructs views from closures.
A modifier that you apply to a view or another view modifier, producing a different version of the original value.