twostraws / Sourceful

A syntax highlighting source editor for iOS and macOS using UITextView and NSTextView.

Home Page:https://www.hackingwithswift.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changes to SwiftUI binding do not update the NSView / UIView

zzt4 opened this issue · comments

If a binding passed to SourceCodeEditor gets updated by some other means than a user directly interacting with the SourceCodeTextEditor, the view is not updated. This is easily replicated by creating a single binding with two SourceCodeTextEditors sharing the same binding. When editing text in one of the views, the other is not updated by the changes. You can quickly demonstrate this bug by creating two SourceCodeTextEditors and using the same text binding for them. When updating text in one editor, it does not update the text in the other.