Improve _ASDisplayViewAccessibility

- Add class method to create a UIAccessibilityElement from a ASDisplayNode
- Add function to iterate through a ASDisplayNode tree in bfs fashion
- Add assert for _accessibleElements in accessibilityElementAtIndex:
This commit is contained in:
Michael Schneider
2016-04-09 16:04:08 -07:00
parent 14ca529911
commit 1b7db082dd
3 changed files with 57 additions and 34 deletions

View File

@@ -87,6 +87,12 @@ extern ASDisplayNode *ASDisplayNodeUltimateParentOfNode(ASDisplayNode *node);
*/
extern void ASDisplayNodePerformBlockOnEveryNode(CALayer * _Nullable layer, ASDisplayNode * _Nullable node, void(^block)(ASDisplayNode *node));
/**
This function will walk the node hierarchy in a breadth first fashion. It does run the block on the node provided
directly to the function call.
*/
extern void ASDisplayNodePerformBlockOnEveryNodeBFS(ASDisplayNode *node, void(^block)(ASDisplayNode *node));
/**
Identical to ASDisplayNodePerformBlockOnEveryNode, except it does not run the block on the
node provided directly to the function call - only on all descendants.