Skip to content

Commit

Permalink
Tweak for VoiceOver: Stay in extended mode if VoiceOver is running
Browse files Browse the repository at this point in the history
  • Loading branch information
nighthawk committed Nov 19, 2021
1 parent 499ec7e commit e864916
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/TGCardViewController/TGCardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ extension TGCardViewController {
top.controller = self

// 1. Determine where the new card will go
let forceExtended = (top.mapManager == nil)
let forceExtended = (top.mapManager == nil) || (cardPosition == .extended && UIAccessibility.isVoiceOverRunning)
let animateTo = cardLocation(forDesired: forceExtended ? .extended : top.initialPosition, direction: .down)

// 2. Updating card logic and informing of transition
Expand Down Expand Up @@ -983,7 +983,7 @@ extension TGCardViewController {
// We only animate to the previous position if the card obscures the map
updateCardStructure(card: newTop?.view, position: newTop?.lastPosition)
let animateTo: TGCardPosition
let forceExtended = newTop?.card.mapManager == nil
let forceExtended = newTop?.card.mapManager == nil || (cardPosition == .extended && UIAccessibility.isVoiceOverRunning)
if forceExtended || !cardIsNextToMap(in: traitCollection) {
let target = cardLocation(forDesired: forceExtended ? .extended : newTop?.lastPosition, direction: .down)
animateTo = target.position
Expand Down

0 comments on commit e864916

Please sign in to comment.