@@ -399,15 +399,16 @@ extension RNSSplitViewHostController: RNSSplitViewNavigationControllerViewFrameO
399399 /// @param inspectors An array of inspector-type RNSSplitViewScreenComponentView subviews.
400400 ///
401401 func maybeSetupInspector( _ inspectors: [ RNSSplitViewScreenComponentView ] ) {
402-
403- if #available( iOS 26 . 0 , * ) {
404- let inspector = inspectors. first
405- if inspector != nil {
406- let inspectorViewController = RNSSplitViewNavigationController (
407- rootViewController: inspector!. controller)
408- setViewController ( inspectorViewController, for: . inspector)
402+ #if !os(tvOS)
403+ if #available( iOS 26 . 0 , * ) {
404+ let inspector = inspectors. first
405+ if inspector != nil {
406+ let inspectorViewController = RNSSplitViewNavigationController (
407+ rootViewController: inspector!. controller)
408+ setViewController ( inspectorViewController, for: . inspector)
409+ }
409410 }
410- }
411+ #endif
411412 }
412413
413414 ///
@@ -417,9 +418,11 @@ extension RNSSplitViewHostController: RNSSplitViewNavigationControllerViewFrameO
417418 /// Uses the UISplitViewController's new API introduced in iOS 26 to show the inspector column.
418419 ///
419420 func maybeShowInspector( ) {
420- if #available( iOS 26 . 0 , * ) {
421- show ( . inspector)
422- }
421+ #if !os(tvOS)
422+ if #available( iOS 26 . 0 , * ) {
423+ show ( . inspector)
424+ }
425+ #endif
423426 }
424427
425428 ///
@@ -429,9 +432,11 @@ extension RNSSplitViewHostController: RNSSplitViewNavigationControllerViewFrameO
429432 /// Uses the UISplitViewController's new API introduced in iOS 26 to hide the inspector column.
430433 ///
431434 func maybeHideInspector( ) {
432- if #available( iOS 26 . 0 , * ) {
433- hide ( . inspector)
434- }
435+ #if !os(tvOS)
436+ if #available( iOS 26 . 0 , * ) {
437+ hide ( . inspector)
438+ }
439+ #endif
435440 }
436441 }
437442#endif
@@ -469,23 +474,27 @@ extension RNSSplitViewHostController: UISplitViewControllerDelegate {
469474 public func splitViewController(
470475 _ svc: UISplitViewController , didHide column: UISplitViewController . Column
471476 ) {
472- if #available( iOS 26 . 0 , * ) {
473- // TODO: we may consider removing this logic, because it could be handled by onViewDidDisappear on the column level
474- // On the other hand, maybe dedicated event related to the inspector would be a better approach.
475- // For now I am leaving it, but feel free to drop this method if there's any reason that `onDidDisappear` works better.
476- if column != . inspector {
477- return
478- }
477+ #if !os(tvOS)
478+ if #available( iOS 26 . 0 , * ) {
479+ // TODO: we may consider removing this logic, because it could be handled by onViewDidDisappear on the column level
480+ // On the other hand, maybe dedicated event related to the inspector would be a better approach.
481+ // For now I am leaving it, but feel free to drop this method if there's any reason that `onDidDisappear` works better.
482+
483+ if column != . inspector {
484+ return
485+ }
479486
480- // `didHide` for modal is called on finger down for dismiss, what is problematic, because we can cancel dismissing modal.
481- // In this scenario, the modal inspector might receive an invalid state and will deviate from the JS value.
482- // Therefore, for event emissions, we need to ensure that the view was detached from the view hierarchy, by checking its window.
483- if let inspectorViewController = viewController ( for: . inspector) {
484- if inspectorViewController. view. window == nil {
485- reactEventEmitter. emitOnHideInspector ( )
487+ // `didHide` for modal is called on finger down for dismiss, what is problematic, because we can cancel dismissing modal.
488+ // In this scenario, the modal inspector might receive an invalid state and will deviate from the JS value.
489+ // Therefore, for event emissions, we need to ensure that the view was detached from the view hierarchy, by checking its window.
490+ if let inspectorViewController = viewController ( for: . inspector) {
491+ if inspectorViewController. view. window == nil {
492+ reactEventEmitter. emitOnHideInspector ( )
493+ }
486494 }
495+
487496 }
488- }
497+ #endif
489498 }
490499 #endif
491500
0 commit comments