How To Use Markdown in SwiftUI
Discover different ways to use Markdown with the Text element in SwiftUI to easily add markdown text to your app.
• 1 min read
Availability
iOS 13.0
macOS 10.15
tvOS 13.0
watchOS 6.0
The markdown feature of the Text
element is a great feature!
You can just type your markdown string and SwiftUI will render the text formatted.
Let's see different ways to use it.
Usage
You can use a string literal
Text("This will be bold")
Or you can pass the text from a variable
let markdownText = "This will be bold"
// […]
Text(.init(markdownText))
Conclusion
Now you can markdown text in your app. Happy coding!
I hope I helped you with you journey with SwiftUI and iOS development.
See you in the next guide!
If you have any question about this article, feel free to email me or tweet me @franceleonidev and share your opinion.
Thank you for reading and see you in the next article!
Share this article