mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
iOS Accessibility: Implement accessibilityPerformEscape gesture to dismiss modals
This commit is contained in:
parent
bc64c30df6
commit
f70fd14065
1 changed files with 24 additions and 3 deletions
|
|
@ -210,9 +210,10 @@ private:
|
|||
addMethod (@selector (accessibilityElementIsFocused), isFocused, "c@:");
|
||||
addMethod (@selector (accessibilityViewIsModal), getIsAccessibilityModal, "c@:");
|
||||
|
||||
addMethod (@selector (accessibilityActivate), accessibilityPerformActivate, "c@:");
|
||||
addMethod (@selector (accessibilityIncrement), accessibilityPerformIncrement, "c@:");
|
||||
addMethod (@selector (accessibilityDecrement), accessibilityPerformDecrement, "c@:");
|
||||
addMethod (@selector (accessibilityActivate), accessibilityPerformActivate, "c@:");
|
||||
addMethod (@selector (accessibilityIncrement), accessibilityPerformIncrement, "c@:");
|
||||
addMethod (@selector (accessibilityDecrement), accessibilityPerformDecrement, "c@:");
|
||||
addMethod (@selector (accessibilityPerformEscape), accessibilityPerformEscape, "c@:");
|
||||
|
||||
#if JUCE_IOS_CONTAINER_API_AVAILABLE
|
||||
if (@available (iOS 11.0, *))
|
||||
|
|
@ -408,6 +409,26 @@ private:
|
|||
return NO;
|
||||
}
|
||||
|
||||
static BOOL accessibilityPerformEscape (id self, SEL)
|
||||
{
|
||||
if (auto* handler = getHandler (self))
|
||||
{
|
||||
if (auto* modal = Component::getCurrentlyModalComponent())
|
||||
{
|
||||
if (auto* modalHandler = modal->getAccessibilityHandler())
|
||||
{
|
||||
if (modalHandler == handler || modalHandler->isParentOf (handler))
|
||||
{
|
||||
modal->exitModalState (0);
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
static id getAccessibilityDataTableCellElementForRowColumn (id self, SEL, NSUInteger row, NSUInteger column)
|
||||
{
|
||||
if (auto* tableInterface = getTableInterface (self))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue