Repository navigation
Complete Split column visibility commands with UIKit hide(column) #4689
juliusmarminge
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Split.Hostexposes UIKit'spreferredDisplayModeproperty andshow(column)command, but does not expose the matchinghide(column)command.Apple documents that assigning
preferredDisplayModechanges the layout immediately unless the assignment occurs in an animation block. For column visibility changes, it recommendsshow(_:)andhide(_:), which choose the closest supported display mode and provide a native transition coordinator:A complete current-API example for FabricExample, rendered as the top-level App on an iPad:
That property's immediate transition agrees with UIKit. Changing it to animate by default would change existing behavior and require the library to choose a duration and curve.
I propose completing
SplitHostCommandsinstead:hidewould forward directly toUISplitViewController.hideColumn:and use the same ref/codegen/lifecycle path asshow. UIKit does not support hidingsecondary, so the new public type should exclude it. Inspector visibility would continue to useshowInspector.Applications could use
hostRef.current?.hide('primary')and the existingshow('primary')for user-triggered sidebar transitions without writing native animation timing or feedingonDisplayModeWillChangeback intopreferredDisplayMode. Property initialization, removal/reset toautomatic, and compact/adaptive layout would keep their current semantics. UIKit would own native interaction, interruption, and accessibility behavior.Would this be an acceptable small addition? I am preparing a focused main-based PR and comparing the example against a standalone UIKit split controller, including rapid retoggling and Reduce Motion. This does not depend on the split-stack prototype in #4666. React Navigation's current v5 adoption draft has no split navigator to adapt, so its split integration remains a downstream gate.
All reactions