The Text view can display one or more lines of text on a screen. It is useful for read-only information.


Text("My Text")
    Modifiers here

Any information enclosed within the double quotes "..." will display on the screen.


The following example adds the text,"Codecademy is Awesome!", on the display screen.

struct ContentView: View {
var body: some View {
VStack {
Text("Codecademy is Awesome!")

This will display the following:

SwiftUI Text View


Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn SwiftUI on Codecademy