Commit 3a776a0
authored
iOS Text Input Refactoring (#3004)
iOS text input had a single monolithic `UIKitTextInputService` that
handled both the Compose path (Compose draws caret/selection) and the
NITI path (UIKit owns caret, handles and context menu) with `if
(usingNativeTextInput)` branches throughout, and a single shared view
reused across sessions.
Each text input session now gets its own dedicated connection object
that owns its view for the duration of the session. The two paths are
split into separate classes with no branching in shared code.
Class Hierarchy changes
**Before:**
```
UIKitTextInputService
└── IntermediateTextInputUIView (IOSSkikoInput protocol)
```
**After:**
```
UIKitTextInputService
├── ComposeTextInputConnection (TextInputConnection) → ComposeTextInputView (TextEditingDelegate)
└── NativeTextInputConnection (TextInputConnection) → NativeTextInputView (NativeTextEditingDelegate)
```
`SelectionContainerConnection` extends `ComposeTextInputConnection` and
makes the SelectionContainer menu scenario explicit — instead of
scattered conditions inside `showMenu`, there is now a dedicated
connection type that clearly represents opening a context menu without
an active text input session.
### Fixes:
[CMP-9972](https://youtrack.jetbrains.com/issue/CMP-9972) [iOS] Refactor
iOS Text Input
## Testing
This should be tested by QA
## Release Notes
N/A1 parent 9adc301 commit 3a776a0
16 files changed
Lines changed: 2318 additions & 1676 deletions
File tree
- compose/ui
- ui-uikit/src/iosMain/objc/CMPUIKitUtils/CMPUIKitUtils
- ui/src
- iosMain/kotlin/androidx/compose/ui
- platform
- scene
- text/input
- window
- uikitInstrumentedTest/kotlin/androidx/compose/ui/leaks
Lines changed: 1 addition & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | | - | |
| 20 | + | |
22 | 21 | | |
23 | 22 | | |
24 | | - | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
| |||
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | 45 | | |
Lines changed: 1 addition & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
| |||
325 | 324 | | |
326 | 325 | | |
327 | 326 | | |
328 | | - | |
329 | | - | |
330 | | - | |
| 327 | + | |
331 | 328 | | |
332 | 329 | | |
333 | 330 | | |
| |||
441 | 438 | | |
442 | 439 | | |
443 | 440 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | 441 | | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 | | |
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
128 | 148 | | |
Lines changed: 0 additions & 198 deletions
This file was deleted.
0 commit comments