File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Sources/OpenSwiftUI/Integration/Hosting/UIKit/View Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ public import UIKit
1010@_spi ( ForOpenSwiftUIOnly)
1111@_spi ( Private)
1212public import OpenSwiftUICore
13+ import COpenSwiftUI
1314
1415// MARK: - _UIHostingView + UIViewControllerProvider
1516
@@ -196,7 +197,21 @@ extension _UIHostingView: ViewRendererHost {
196197 @available ( OpenSwiftUI_v6_0, * )
197198 public func beginTransaction( ) {
198199 onMainThread { [ weak self] in
199- // TODO: UIKitUpdateCycle
200+ guard UIKitUpdateCycle . defaultUseSetNeedsLayout else {
201+ let updateAction = {
202+ Update . ensure {
203+ _ = self ? . updateGraph {
204+ $0. flushTransactions ( )
205+ }
206+ }
207+ }
208+ if _UIUpdateCycleEnabled ( ) {
209+ UIKitUpdateCycle . addPreCommitObserver ( updateAction)
210+ }
211+ RunLoop . addObserver ( updateAction)
212+ return
213+ }
214+ self ? . base. requestImmediateUpdate ( )
200215 }
201216 }
202217
You can’t perform that action at this time.
0 commit comments