© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022W. WangBeginning iPhone Development with SwiftUIhttps://doi.org/10.1007/978-1-4842-7818-5_4
Every user interface needs to display information on the screen. While this information can appear in a variety of forms, one common type of information to display on the user interface involves text
. If you want to display text on the user interface, you need to define a string to appear in a Text view such as
For greater flexibility, you can store a string in a variable or constant and then use that variable or constant name
in a Text view such as
let myString = "Displays a string variable" ...