Skip to content

Commit 43d53bc

Browse files
authored
Post .screenChanged event on some screen transitions that need manual invocation (#182)
This makes all transitions on the Demo app controllable using just VoiceOver highlighting. TODO: Snackbars need manual handling for the `.announcement` event, since they require a text hint that needs to be automatically read by VoiceOver without changing the existing focus.
1 parent 1d0717b commit 43d53bc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/FluidStack/ViewController/FluidStackController.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ open class FluidStackController: UIViewController {
178178
// MARK: - Functions
179179

180180
open func stackingViewControllersDidChange(_ viewControllers: [UIViewController]) {
181-
181+
UIAccessibility.post(notification: .screenChanged, argument: nil)
182182
}
183183

184184
public func stackingDescription() -> String {
@@ -385,6 +385,7 @@ open class FluidStackController: UIViewController {
385385

386386
newTransitionContext.addCompletionEventHandler { event in
387387
completion?(event)
388+
UIAccessibility.post(notification: .screenChanged, argument: nil)
388389
}
389390

390391
platterView.swapTransitionContext(newTransitionContext)
@@ -953,11 +954,10 @@ open class PresentationFluidStackController: FluidStackController {
953954
}
954955

955956
open override func stackingViewControllersDidChange(_ viewControllers: [UIViewController]) {
956-
957957
if viewControllers.isEmpty {
958958
dismiss(animated: false)
959959
}
960-
960+
UIAccessibility.post(notification: .screenChanged, argument: nil)
961961
}
962962

963963
}

0 commit comments

Comments
 (0)