Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

SwiftUI's docs are a nightmare.

Here's a pretty damn cool app: https://swiftui-lab.com



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


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.


For 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: