SwiftUI .italic()
Published Jan 2, 2023Updated Mar 18, 2023
The .italic() view modifier method in SwiftUI can be used to make text within a view appear in italic style.
Syntax
Text("This text will be italic")
.italic()
Example
var body: some View {Text("I hope this appears as italic.").italic()}
This will display:

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