Compose with the content builder
Use Heading, Paragraph, and list types where the content belongs in code.
swift
import SwiftUI
import MarkdownUI
struct ReleaseNotesView: View {
var body: some View {
MarkdownView {
Heading(.level2) { "Release notes" }
Paragraph {
Strong("MarkdownUI")
" renders Markdown in SwiftUI."
}
TaskList {
TaskListItem(isCompleted: true) { "Parse Markdown" }
TaskListItem { "Apply a theme" }
}
}
}
}