Hi, I want users of a swiftui app to be able to enter text in a field, and to:
- Change text style
- Change text size
- Add bullet lists
What's the general direction I should take to implement this, possibly without using an external library?
Hi, I want users of a swiftui app to be able to enter text in a field, and to:
What's the general direction I should take to implement this, possibly without using an external library?
The SwiftUI TextEditor
view does not currently support rich text. You will have to wrap either UITextView
(iOS) or NSTextView
(Mac) using the UIViewRepresentable
or NSViewRepresentable
protocols. Search for UIViewRepresentable in a search engine to find articles on how to do this. You may also find the following article helpful even though it doesn't deal specifically with rich text:
swiftdevjournal.com/using-text-views-in-a-swiftui-app/
Not WYSIWYG as such, but you could look at using Markdown in Text views.