mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 19:30:29 +00:00
Implemented UIAccessibilityIdentification for ASDisplayNode
This commit is contained in:
parent
1a7723d0c6
commit
a299a5b550
@ -533,6 +533,9 @@ typedef CALayer *(^ASDisplayNodeLayerBlock)();
|
||||
@property (atomic, assign) BOOL accessibilityViewIsModal;
|
||||
@property (atomic, assign) BOOL shouldGroupAccessibilityChildren;
|
||||
|
||||
// Accessibility identification support
|
||||
@property (nonatomic, copy) NSString *accessibilityIdentifier;
|
||||
|
||||
@end
|
||||
|
||||
/*
|
||||
|
||||
@ -75,6 +75,9 @@
|
||||
@property (atomic, assign) BOOL shouldGroupAccessibilityChildren;
|
||||
*/
|
||||
|
||||
// Accessibility identification support
|
||||
@property (nonatomic, copy) NSString *accessibilityIdentifier;
|
||||
|
||||
@end
|
||||
|
||||
@interface CALayer (ASDisplayNodeLayer)
|
||||
|
||||
@ -642,6 +642,18 @@
|
||||
_setToViewOnly(shouldGroupAccessibilityChildren, shouldGroupAccessibilityChildren);
|
||||
}
|
||||
|
||||
- (NSString *)accessibilityIdentifier
|
||||
{
|
||||
_bridge_prologue;
|
||||
return _getFromViewOnly(accessibilityIdentifier);
|
||||
}
|
||||
|
||||
- (void)setAccessibilityIdentifier:(NSString *)accessibilityIdentifier
|
||||
{
|
||||
_bridge_prologue;
|
||||
_setToViewOnly(accessibilityIdentifier, accessibilityIdentifier);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@ -48,6 +48,7 @@
|
||||
BOOL accessibilityElementsHidden;
|
||||
BOOL accessibilityViewIsModal;
|
||||
BOOL shouldGroupAccessibilityChildren;
|
||||
NSString *accessibilityIdentifier;
|
||||
|
||||
struct {
|
||||
// Properties
|
||||
@ -97,6 +98,7 @@
|
||||
int setAccessibilityElementsHidden:1;
|
||||
int setAccessibilityViewIsModal:1;
|
||||
int setShouldGroupAccessibilityChildren:1;
|
||||
int setAccessibilityIdentifier:1;
|
||||
} _flags;
|
||||
}
|
||||
|
||||
@ -187,6 +189,7 @@
|
||||
accessibilityElementsHidden = NO;
|
||||
accessibilityViewIsModal = NO;
|
||||
shouldGroupAccessibilityChildren = NO;
|
||||
accessibilityIdentifier = nil;
|
||||
edgeAntialiasingMask = (kCALayerLeftEdge | kCALayerRightEdge | kCALayerTopEdge | kCALayerBottomEdge);
|
||||
|
||||
return self;
|
||||
@ -542,6 +545,19 @@
|
||||
_flags.setShouldGroupAccessibilityChildren = YES;
|
||||
}
|
||||
|
||||
- (NSString *)accessibilityIdentifier
|
||||
{
|
||||
return accessibilityIdentifier;
|
||||
}
|
||||
|
||||
- (void)setAccessibilityIdentifier:(NSString *)newAccessibilityIdentifier
|
||||
{
|
||||
_flags.setAccessibilityIdentifier = YES;
|
||||
if (accessibilityIdentifier != newAccessibilityIdentifier) {
|
||||
accessibilityIdentifier = [newAccessibilityIdentifier copy];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)applyToLayer:(CALayer *)layer
|
||||
{
|
||||
if (_flags.setAnchorPoint)
|
||||
@ -775,6 +791,9 @@
|
||||
|
||||
if (_flags.setShouldGroupAccessibilityChildren)
|
||||
view.shouldGroupAccessibilityChildren = shouldGroupAccessibilityChildren;
|
||||
|
||||
if (_flags.setAccessibilityIdentifier)
|
||||
view.accessibilityIdentifier = accessibilityIdentifier;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user