1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-05 03:50:07 +00:00

iOS: Fix compatibility when targeting older SDK versions

This commit is contained in:
ed 2021-10-08 11:29:29 +01:00
parent f5f834f758
commit e1d1dd380c
3 changed files with 20 additions and 7 deletions

View file

@ -117,7 +117,11 @@ private:
addMethod (@selector (isAccessibilityElement), getIsAccessibilityElement, "c@:");
addMethod (@selector (accessibilityFrame), getAccessibilityFrame, @encode (CGRect), "@:");
addMethod (@selector (accessibilityElements), getAccessibilityElements, "@@:");
addMethod (@selector (accessibilityContainerType), getAccessibilityContainerType, "i@:");
#if JUCE_IOS_CONTAINER_API_AVAILABLE
if (@available (iOS 11.0, *))
addMethod (@selector (accessibilityContainerType), getAccessibilityContainerType, "i@:");
#endif
addIvar<AccessibilityHandler*> ("handler");
@ -210,11 +214,16 @@ private:
addMethod (@selector (accessibilityIncrement), accessibilityPerformIncrement, "c@:");
addMethod (@selector (accessibilityDecrement), accessibilityPerformDecrement, "c@:");
addMethod (@selector (accessibilityDataTableCellElementForRow:column:), getAccessibilityDataTableCellElementForRowColumn, "@@:ii");
addMethod (@selector (accessibilityRowCount), getAccessibilityRowCount, "i@:");
addMethod (@selector (accessibilityColumnCount), getAccessibilityColumnCount, "i@:");
addMethod (@selector (accessibilityRowRange), getAccessibilityRowIndexRange, @encode (NSRange), "@:");
addMethod (@selector (accessibilityColumnRange), getAccessibilityColumnIndexRange, @encode (NSRange), "@:");
#if JUCE_IOS_CONTAINER_API_AVAILABLE
if (@available (iOS 11.0, *))
{
addMethod (@selector (accessibilityDataTableCellElementForRow:column:), getAccessibilityDataTableCellElementForRowColumn, "@@:ii");
addMethod (@selector (accessibilityRowCount), getAccessibilityRowCount, "i@:");
addMethod (@selector (accessibilityColumnCount), getAccessibilityColumnCount, "i@:");
addMethod (@selector (accessibilityRowRange), getAccessibilityRowIndexRange, @encode (NSRange), "@:");
addMethod (@selector (accessibilityColumnRange), getAccessibilityColumnIndexRange, @encode (NSRange), "@:");
}
#endif
if (elementType == Type::textElement)
{

View file

@ -28,7 +28,7 @@ static void juceFreeAccessibilityPlatformSpecificData (NSAccessibilityElement<NS
namespace juce
{
#if (! defined MAC_OS_X_VERSION_10_13) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
#if ! defined (MAC_OS_X_VERSION_10_13) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13
using NSAccessibilityRole = NSString*;
using NSAccessibilityNotificationName = NSString*;
#endif

View file

@ -26,6 +26,10 @@
namespace juce
{
#if ! defined (__IPHONE_10_0) || __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_10_0
using UIActivityType = NSString*;
#endif
class ContentSharer::ContentSharerNativeImpl : public ContentSharer::Pimpl,
private Component
{