MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / tabBarControlLabel

Function tabBarControlLabel

packages/nativescript-inspector/src/index.ts:1712–1727  ·  view source on GitHub ↗
(control: any)

Source from the content-addressed store, hash-verified

1710}
1711
1712function tabBarControlLabel(control: any): string {
1713 const accessibility = accessibilityInfo(control);
1714 const label = stringValue(accessibility.label);
1715 if (label) {
1716 return label;
1717 }
1718 const text = textValue(control);
1719 if (text) {
1720 return text;
1721 }
1722 const labelView = findSubview(
1723 control,
1724 (view) => isKindOf(view, "UILabel") && Boolean(textValue(view)),
1725 );
1726 return labelView ? textValue(labelView) : "";
1727}
1728
1729function hasUsableFrame(frame: JSONObject | null): boolean {
1730 return rectNumber(frame, "width") > 1 && rectNumber(frame, "height") > 1;

Callers 1

Calls 5

accessibilityInfoFunction · 0.85
stringValueFunction · 0.85
textValueFunction · 0.85
findSubviewFunction · 0.85
isKindOfFunction · 0.85

Tested by

no test coverage detected