How to set Uppercase for Text in SwiftUI?

SwiftUI Text – Uppercase

To set uppercase for text in Text view, call textCase() method on this Text view, with .uppercase value passed as argument.


In the following example, we have a Text view. We will set its text case to uppercase using textCase() method.


import SwiftUI

struct ContentView: View {
    var body: some View {
        Text("Hello World!")


SwiftUI Text - Uppercase


Summarising this SwiftUI Tutorial, we learned how to set uppercase for the text in Text view.