Commit 360230b
authored
fix:
## 📜 Description
Added rounded corners to `KeyboardExtender` on iOS 26 to match Apple
guidelines.
## 💡 Motivation and Context
We need to specify `cornerConfiguration` property. By default in first
OS versions it always had rounded corners, but in beta 5 it has
rectangle corners again.
The biggest issue was in the fact on how to add it and don't break
compilation for older XCode versions. Before I used `NSClassFromString`,
but since we need to use setter for that (and we need to set structure,
not primitive values) this approach can not be easily utilized. Even if
we'll use `respondTo` - the application will crash telling that selector
is not exposed in objc 🤷♂️ Moreover this approach (with dynamic class
lookup) is bad, because if the app was compiled on XCode 16.4 but is
running on iOS 18, then `KeyboardExtender` will not be visible at all -
we'll try to use unexisting class and will not create a view, but since
base class is `UIInputView` we'll get something like this:
<img width="300" height="655" alt="image"
src="https://github.com/user-attachments/assets/2c2656b7-9812-44c9-b118-7f2d4d44448c"
/>
The other idea that I had was detecting xcode version during pod
installation. White it works it also not a very bulletproof solution,
because if you had two XCode on your laptop, then you can install it
with XCode 26, but compilation with XCode 16 will fail.
The most safe approach is to use `canImport` directive - this is what I
used in this PR. I also wrapped a logic with container selection, to
prevent the issue with incompatibility (i. e. compiled with XCode 16
running on iOS 26).
## 📢 Changelog
<!-- High level overview of important changes -->
<!-- For example: fixed status bar manipulation; added new types
declarations; -->
<!-- If your changes don't affect one of platform/language below - then
remove this platform/language -->
### iOS
- wrap in `#if canImport(UIKit.UIGlassEffect)` the `UIGlassEffect`
usage.
## 🤔 How Has This Been Tested?
Tested manually on iPhone 16 Pro (iOS 26.0, 18.5).
## 📸 Screenshots (if appropriate):
|Before|After|
|-------|-----|
|<img width="603" height="1311" alt="Screenshot 2025-08-07 at 10 21 06"
src="https://github.com/user-attachments/assets/c89b11dc-cec9-4b2e-879a-5fd6c247d32d"
/>|<img width="603" height="1311" alt="Screenshot 2025-08-07 at 10 19
30"
src="https://github.com/user-attachments/assets/6c08e358-c574-4679-83a8-0331113bc044"
/>|
## 📝 Checklist
- [x] CI successfully passed
- [x] I added new mocks and corresponding unit-tests if library API was
changedKeyboardExtender on iOS 26 with round corners (#1067)1 parent af6d19d commit 360230b
2 files changed
Lines changed: 25 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| |||
0 commit comments