You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: