From d85007308d234dda73603afbe9f72d6b1679d058 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Tue, 6 Jan 2026 10:48:11 -0500 Subject: [PATCH] fix: Toggle the code editor in the iOS Demo app Restore the Swift Observation framework pattern that was likely unintentionally removed in PR #250, allowing the code editor toggle to properly trigger `updateUIViewController` when the state changes. --- ios/Demo-iOS/Sources/Views/EditorView.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ios/Demo-iOS/Sources/Views/EditorView.swift b/ios/Demo-iOS/Sources/Views/EditorView.swift index b8a0361dc..f47538f2a 100644 --- a/ios/Demo-iOS/Sources/Views/EditorView.swift +++ b/ios/Demo-iOS/Sources/Views/EditorView.swift @@ -5,7 +5,7 @@ struct EditorView: View { private let configuration: EditorConfiguration private let dependencies: EditorDependencies? - @StateObject private var viewModel = EditorViewModel() + @State private var viewModel = EditorViewModel() @Environment(\.dismiss) var dismiss @@ -216,7 +216,8 @@ private struct _EditorView: UIViewControllerRepresentable { } } -private final class EditorViewModel: ObservableObject { +@Observable +private final class EditorViewModel { var isModalDialogOpen = false var hasUndo = false var hasRedo = false