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

Function editablePropertiesFor

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

Source from the content-addressed store, hash-verified

2191}
2192
2193function editablePropertiesFor(target: any): string[] {
2194 const properties = new Set(defaultEditableProperties);
2195 if (
2196 isKindOf(target, "UILabel") ||
2197 isKindOf(target, "UITextField") ||
2198 isKindOf(target, "UITextView")
2199 ) {
2200 properties.add("text");
2201 properties.add("textColor");
2202 }
2203 if (isKindOf(target, "UIScrollView")) {
2204 properties.add("contentOffset");
2205 }
2206 if (isKindOf(target, "UISwitch")) {
2207 properties.add("on");
2208 }
2209 if (isKindOf(target, "UISlider")) {
2210 properties.add("value");
2211 }
2212 if (isKindOf(target, "UISegmentedControl")) {
2213 properties.add("selectedSegmentIndex");
2214 }
2215 return [...properties].sort();
2216}
2217
2218function isKindOf(object: any, classNameValue: string): boolean {
2219 const klass = safeCall(() => NSClassFromString(classNameValue), null);

Callers 1

getPropertiesMethod · 0.85

Calls 1

isKindOfFunction · 0.85

Tested by

no test coverage detected