danielsaidi / RichTextKit

RichTextKit is a Swift SDK that helps you use rich text in Swift and SwiftUI.
MIT License
885 stars 114 forks source link

A simple demo or documentation on how to show RichTextView #135

Closed balsimpson closed 7 months ago

balsimpson commented 8 months ago

This is a fantastic library and the documentation is excellent. Yet, as a starting SwiftUI developer, even after poring through the documentation several times, I could not figure out how to display the RichText using a RichTextView. Or should I be using `RichTextReader'. Any help is greatly appreciated.

danielsaidi commented 8 months ago

Hi @balsimpson

Thank you! :) In SwiftUI, the RichTextEditor is the way to go, while the RichTextView is a UIKit/AppKit specific view that is used under the hood.

I will adjust the documentation a bit before the 1.0 release.

balsimpson commented 8 months ago

Thanks for the speedy reply. So in my Notes app I should use the RichTextEditor to display the content of all the notes? But won't that make it all editable in the List view itself?

A little more documentation on the Toolbar customisation also is highly appreciated.

danielsaidi commented 8 months ago

Having the editor in read-only mode should be supported.

I'll tag this with documentation todos, and hope I get around to it before 1.0.

Guerrix commented 7 months ago

Hello, is there a way to use RichTextKeyboardToolbar or similar in a RichTextView? Thanks

danielsaidi commented 7 months ago

Hi @Guerrix

RichTextView is a UIKit/AppKit component, while RichTextEditor & RichTextKeyboardToolbar are built in SwiftUI.

If you want to use the toolbar with the text view, you need to wrap it...but I think it'd be rather messy.

danielsaidi commented 7 months ago

I have added a new, more basic demo app that I hope is easier to understand.

You can find it in the main branch for now.