Replying to an HTML email on iOS used to dump raw
<br> and <div style='...'>
tags into a plain TextField. Not great.
The new RichTextEditor is a
UIViewRepresentable wrapping
UITextView with two-way HTML round-tripping:
- On first layout it parses the server HTML via
NSAttributedString(data:options:)withDocumentType.html, then normalises the typography to the system body font +UIColor.labelso the quoted block doesn't render as Times New Roman 12pt on dark mode. allowsEditingTextAttributes = truesurfaces the iOS selection menu with Bold / Italic / Underline for free — no custom toolbar needed for MVP.- On change,
textViewDidChangeserialises back to HTML viaattributedText.data(from:documentAttributes:)and writes to the SwiftUI binding on the next runloop tick (avoids feedback loops withupdateUIView).
The backend /mail/send endpoint already treats the
body as HTML, so outgoing mail looks the same whether you composed
it on the web or on iPhone.
T
The Tacitus Mail team
Engineering posts and release notes from the people who write the code.