How to set Text to Italic in SwiftUI?

SwiftUI – Italic Text

To make the text italic in Text view, call italic() method on this Text view. italic() method applies italics to the text in this Text view.


In the following example, we created a Text view, and called italic() method on the Text view.


import SwiftUI

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


Text view – Italic text


Summarising this SwiftUI Tutorial, we learned how to apply italics to the text in Text view.