(target: any)
| 2191 | } |
| 2192 | |
| 2193 | function 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 | |
| 2218 | function isKindOf(object: any, classNameValue: string): boolean { |
| 2219 | const klass = safeCall(() => NSClassFromString(classNameValue), null); |
no test coverage detected