(view: any)
| 2111 | } |
| 2112 | |
| 2113 | function 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 | |
| 2133 | function scrollInfo(view: any): JSONObject | null { |
| 2134 | if (!isKindOf(view, "UIScrollView")) { |
no test coverage detected