Files
flipper/iOS/Plugins/FlipperKitUIDebuggerPlugin/FlipperKitUIDebuggerPlugin/Serializers/UIDNode+Foundation.m
Sash Zats 550b49e690 Capture accessibility hierarchy and package it for the sonar plugin
Summary: In this diff we load and call a private API enabling voiceover hierarchy and pass it over via existing channel when client is in the accessibility mode

Reviewed By: lblasa

Differential Revision: D49393813

fbshipit-source-id: 437af1131547218cd52f4a56797707411787d7cf
2023-09-20 12:41:38 -07:00

48 lines
1.2 KiB
Objective-C

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#if FB_SONARKIT_ENABLED
#import "NSDictionary+Foundation.h"
#import "UIDBounds+Foundation.h"
#import "UIDNode+Foundation.h"
FB_LINKABLE(UIDNode_Foundation)
@implementation UIDNode (Foundation)
- (id)toFoundation {
NSMutableDictionary* data = [NSMutableDictionary dictionaryWithDictionary:@{
@"id" : [NSNumber numberWithUnsignedInt:self.identifier],
@"qualifiedName" : self.qualifiedName ?: @"",
@"name" : self.name,
@"bounds" : [self.bounds toFoundation],
@"tags" : self.tags ? self.tags.allObjects : @[],
@"inlineAttributes" : self.inlineAttributes ?: @{},
@"children" : self.children,
}];
if (self.activeChild) {
[data setObject:self.activeChild forKey:@"activeChild"];
}
if (self.attributes) {
[data setObject:[self.attributes toFoundation] forKey:@"attributes"];
}
if (self.hiddenAttributes) {
[data setObject:[self.hiddenAttributes toFoundation]
forKey:@"hiddenAttributes"];
}
if (self.parent) {
[data setObject:self.parent forKey:@"parent"];
}
return data;
}
@end
#endif