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

Function textValue

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

Source from the content-addressed store, hash-verified

2111}
2112
2113function textValue(view: any): string {
2114 if (
2115 isKindOf(view, "UILabel") ||
2116 isKindOf(view, "UITextField") ||
2117 isKindOf(view, "UITextView")
2118 ) {
2119 return stringValue(read(view, "text"));
2120 }
2121 if (isKindOf(view, "UIButton")) {
2122 return stringValue(call(view, "titleForState", read(view, "state")));
2123 }
2124 if (isKindOf(view, "UISegmentedControl")) {
2125 const index = numberValue(read(view, "selectedSegmentIndex"), -1);
2126 return index >= 0
2127 ? stringValue(call(view, "titleForSegmentAtIndex", index))
2128 : "";
2129 }
2130 return "";
2131}
2132
2133function scrollInfo(view: any): JSONObject | null {
2134 if (!isKindOf(view, "UIScrollView")) {

Callers 4

nativeScriptNodeMethod · 0.85
uikitNodeMethod · 0.85
uikitFrameLabelFunction · 0.85
tabBarControlLabelFunction · 0.85

Calls 5

isKindOfFunction · 0.85
stringValueFunction · 0.85
readFunction · 0.85
callFunction · 0.85
numberValueFunction · 0.85

Tested by

no test coverage detected