5 ms·
Excellent, thanks for this! Most recent post is "Attributed Strings with SwiftUI" which is something I was wondering about. There's plaintext TextEditor view,
by wlesieutre 6y ago
Excellent, thanks for this!
Most recent post is "Attributed Strings with SwiftUI" which is something I was wondering about. There's plaintext TextEditor view, but for rich text editing the impression I've gotten is to either fall back to something in UIKit or do it in a WebView. Will check this post out tonight, it might not change anything but I'd at least like a better idea where things stand in SwiftUI.
Props to Apple on this one, TextEditor has a real docs page. But it's only for plain text, sadly: https://developer.apple.com/documentation/swiftui/texteditor https://developer.apple.com/documentation/swiftui/texteditor
- terhechte 6y agoYeah, for rich text you need to wrap a UITextView, there's currently no other way to do that. Also, if you have a large amount of text, TextEditor won't cut it either. Even displaying rich text (non editable) is a wee bit tricky and severely under documented.
- lukeh 6y agoYeah, the sizing thing is a bit of a pain as the creates visible content fitting artefacts when contained in a list or stack.
- jamil7 6y agoFor a small app I recently just wrapped SlateJS in a webview and passed json back and forth. Slate is pretty nice but it would be nice to use a native solution.