Re:On Apple's Piss-Poor Documentation
by wlesieutre on Tuesday November 10, 2020 @11:18AM
(#25047641)
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
Re:On Apple's Piss-Poor Documentation
by terhechte on Tuesday November 10, 2020 @12:53PM
(#25048791)
Yeah, 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.
Yeah, the sizing thing is a bit of a pain as the creates visible content fitting artefacts when contained in a list or stack.
Here's a pretty damn cool app: https://swiftui-lab.com