import SwiftUI
struct ContentView: View {
var body: some View {
Text("Hello, SwiftUI!")
.font(.largeTitle)
.foregroundColor(.blue)
.padding()
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Color.white)
.multilineTextAlignment(.center)
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}We created a Text view with the string "Hello, SwiftUI!". Then, we applied the .font(.largeTitle) modifier to make the text large. The .foregroundColor(.blue) modifier changes the text color to blue. We added .padding() to give space around the text so it doesn't touch the edges. To center the text both vertically and horizontally, we used .frame(maxWidth: .infinity, maxHeight: .infinity) which expands the view to fill the screen, and the text is centered by default inside this frame. The background is set to white for clarity. This creates a simple, styled text label centered on the screen.