Text and symbol modifiers
Manage the rendering, selection, and entry of text in your view.
Overview
SwiftUI provides built-in views that display text to the user, like Text and Label, or that collect text from the user, like TextField and TextEditor. Use text and symbol modifiers to control how SwiftUI displays and manages that text. For example, you can set a font, specify text layout parameters, and indicate what kind of input to expect.
To learn more about the kinds of views that you use to display text and the ways in which you can configure those views, see Text input and output.
Topics
Fonts
Dynamic type
Text style
bold(_:)fontDesign(_:)fontWeight(_:)fontWidth(_:)italic(_:)monospaced(_:)monospacedDigit()strikethrough(_:pattern:color:)textCase(_:)textScale(_:isEnabled:)underline(_:pattern:color:)
Text layout
allowsTightening(_:)baselineOffset(_:)flipsForRightToLeftLayoutDirection(_:)kerning(_:)minimumScaleFactor(_:)tracking(_:)truncationMode(_:)typesettingLanguage(_:isEnabled:)
Multiline text
lineLimit(_:)lineLimit(_:reservesSpace:)lineSpacing(_:)multilineTextAlignment(_:)multilineTextAlignment(strategy:)
Text selection
Text entry
autocorrectionDisabled(_:)keyboardType(_:)scrollDismissesKeyboard(_:)textInputAutocapitalization(_:)textInputCompletion(_:)textInputSuggestions(_:)textInputSuggestions(_:content:)textInputSuggestions(_:id:content:)textContentType(_:)textContentType(_:)textContentType(_:)