danielsaidi / RichTextKit

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

Update EditorScreen.swift to include clear button #49

Closed IRFAANFTK closed 1 year ago

IRFAANFTK commented 1 year ago

Added function to clear the text editor

danielsaidi commented 1 year ago

Hi @IRFAANFTK

While I like the idea of adding this to the demo, I don't think this is the way to do it.

Using the id binding to redraw the view when the button is tapped does update the view, but I'd rather find a way to make this happen automatically when modifying the text binding.

danielsaidi commented 1 year ago

Hi again @IRFAANFTK

I have updated the rich text context with new functions for resetting and setting the attributed string, so this is no longer as tricky as it was before.

I'm closing this, since I'm not sure we need it :)