Controls and indicators
Display values and get user selections.
Overview
SwiftUI provides controls that enable user interaction specific to each platform and context. For example, people can initiate events with buttons and links, or choose among a set of discrete values with different kinds of pickers. You can also display information to the user with indicators like progress views and gauges.
[Image]
Use these built-in controls and indicators when composing custom views, and style them to match the needs of your app’s user interface. For design guidance, see Menus and actions, Selection and input, and Status in the Human Interface Guidelines.
Topics
Creating buttons
ButtonbuttonStyle(_:)buttonBorderShape(_:)buttonRepeatBehavior(_:)buttonRepeatBehaviorButtonBorderShapeButtonRoleButtonRepeatBehaviorButtonSizing
Creating special-purpose buttons
Linking to other content
Getting numeric inputs
Choosing from a set of options
PickerpickerStyle(_:)horizontalRadioGroupLayout()defaultWheelPickerItemHeight(_:)defaultWheelPickerItemHeightpaletteSelectionEffect(_:)PaletteSelectionEffect
Choosing dates
Choosing a color
Indicating a value
Indicating missing content
Providing haptic feedback
sensoryFeedback(_:trigger:)sensoryFeedback(trigger:_:)sensoryFeedback(_:trigger:condition:)SensoryFeedback