danielsaidi / RichTextKit

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

Editor not updating with list of files #188

Closed MatthewWaller closed 3 months ago

MatthewWaller commented 3 months ago

Making a Notes style app.

For a List of files in ForEach and NavigationStack, I have the richtexteditor in the detail, and when I switch to different files in the sidebar of the Mac or iPad app, the editor doesn’t change.

Is there a way, when the navigation changes to the new file, to make the editor reflect the new text?

feixue299 commented 3 months ago

You can modify the value using the setAttributedString method in RichTextContext

MatthewWaller commented 3 months ago

Ah thanks.