.italic()
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.
Syntax
Text("This text will be italic")
.italic()
Example
var body: some View {Text("I hope this appears as italic.").italic()}
This will display:
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn SwiftUI on Codecademy
- Skill path
Build iOS Apps with SwiftUI
Learn how to build iOS applications with Swift and SwiftUI and publish them to Apples' App Store.Includes 7 CoursesWith CertificateBeginner Friendly13 hours - Free course
Learn Swift
A powerful programming language developed by Apple for iOS, macOS, and more.Beginner Friendly12 hours