Skip to content

Commit e04fe6b

Browse files
committed
Add OPENSWIFTUI_LINK_BACKLIGHTSERVICES guards to UIKit hosting views
1 parent 2c6fbf5 commit e04fe6b

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Sources/OpenSwiftUI/Integration/Hosting/UIKit/Controller/UIHostingController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ public import UIKit
88
open class UIHostingController<Content>: UIViewController where Content : View {
99
var host: _UIHostingView<Content>
1010

11+
#if OPENSWIFTUI_LINK_BACKLIGHTSERVICES
1112
var alwaysOnBridge: AlwaysOnBridge<Content>?
13+
#endif
1214

1315
override open dynamic var keyCommands: [UIKeyCommand]? {
1416
// TODO

Sources/OpenSwiftUI/Integration/Hosting/UIKit/View/UIHostingView.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,11 @@ open class _UIHostingView<Content>: UIView, XcodeViewDebugDataProvider where Con
284284
if shouldDisableUIKitAnimations,
285285
Semantics.TraitCollectionAnimations.isEnabled,
286286
var transaction = Transaction.currentUIViewTransaction(canDisableAnimations: true) {
287+
#if OPENSWIFTUI_LINK_BACKLIGHTSERVICES
287288
if let viewController, let alwaysOnBridge = viewController.alwaysOnBridge {
288289
alwaysOnBridge.configureTransaction(&transaction)
289290
}
291+
#endif
290292
viewGraph.emptyTransaction(transaction)
291293
}
292294
}
@@ -567,7 +569,9 @@ extension _UIHostingView {
567569
let box: WeakBox<UIView> = WeakBox(host)
568570
let boxAttr = Attribute(value: box)
569571
// inputs[UIKitHostContainerFocusItemInput.self] = boxAttr
572+
#if OPENSWIFTUI_LINK_BACKLIGHTSERVICES
570573
inputs.textAlwaysOnProvider = OpenSwiftUITextAlwaysOnProvider.self
574+
#endif
571575
// navigationBridge?.updateViewInputs(&inputs)
572576
}
573577
}

0 commit comments

Comments
 (0)