-
Notifications
You must be signed in to change notification settings - Fork 79
Open
Description
Really love this framework; great job on it! I have an app that I'm building that displays some JSON return values from API calls. It's sort of like a native iOS/macOS demo app to show off the features of a backend API service. So my need wasn't really an editor but a pretty printed JSON output view. The app is SwiftUI based, and I noticed that the binding for the text only works one way. If I change the @State string in the SwiftUI view programmatically (such as when my API call returns with the JSON data and puts it in the state property) the SourceCodeTextEditor view doesn't update.
struct AppRootView: View {
@State private var editorText = ""
var body: some View {
VStack {
Button("Insert JSON") {
editorText = "{ \"value\": \"Hello, World!\"}"
// Does not update the contents of the SourceCodeTextEditor
}
SourceCodeTextEditor(text: $editorText)
}
}
}
It would appear that there is no observer attached to the binding on the UIKit/AppKit side of the bridge to synchronize the underlying NS(UI)TextView.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels