SwiftUI .italic()

Prince25's avatar
Published Jan 2, 2023Updated Mar 18, 2023
Contribute to Docs

The .italic() view modifier method in SwiftUI can be used to make text within a view appear in italic style.

  • Learn how to build iOS applications with Swift and SwiftUI and publish them to Apples' App Store.
    • Includes 7 Courses
    • With Certificate
    • Beginner Friendly.
      13 hours
  • A powerful programming language developed by Apple for iOS, macOS, and more.
    • Beginner Friendly.
      12 hours

Syntax

Text("This text will be italic")
    .italic()

Example

var body: some View {
Text("I hope this appears as italic.")
.italic()
}

This will display:

SwiftUI ViewModifier Italic

All contributors

Contribute to Docs

Learn SwiftUI on Codecademy

  • Learn how to build iOS applications with Swift and SwiftUI and publish them to Apples' App Store.
    • Includes 7 Courses
    • With Certificate
    • Beginner Friendly.
      13 hours
  • A powerful programming language developed by Apple for iOS, macOS, and more.
    • Beginner Friendly.
      12 hours