Skip to content

fix: KeyboardExtender on iOS 26 with round corners#1067

Merged
kirillzyusko merged 4 commits intomainfrom
fix/ios-26-keyboard-extender-round-corners
Aug 9, 2025
Merged

fix: KeyboardExtender on iOS 26 with round corners#1067
kirillzyusko merged 4 commits intomainfrom
fix/ios-26-keyboard-extender-round-corners

Conversation

@kirillzyusko
Copy link
Copy Markdown
Owner

@kirillzyusko kirillzyusko commented Aug 7, 2025

📜 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:

image

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

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
Screenshot 2025-08-07 at 10 21 06 Screenshot 2025-08-07 at 10 19 30

📝 Checklist

  • CI successfully passed
  • I added new mocks and corresponding unit-tests if library API was changed

@kirillzyusko kirillzyusko self-assigned this Aug 7, 2025
@kirillzyusko kirillzyusko added 🐛 bug Something isn't working KeyboardExtender 🧩 Anything about keyboard extending (i. e. `KeyboardExtender` component)  iOS 26 Anything specific to iOS 26 labels Aug 7, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 7, 2025

📊 Package size report

Current size Target Size Difference
212830 bytes 212821 bytes 9 bytes 📈

@kirillzyusko kirillzyusko marked this pull request as ready for review August 9, 2025 13:32
@kirillzyusko kirillzyusko merged commit 360230b into main Aug 9, 2025
15 checks passed
@kirillzyusko kirillzyusko deleted the fix/ios-26-keyboard-extender-round-corners branch August 9, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working  iOS 26 Anything specific to iOS 26 KeyboardExtender 🧩 Anything about keyboard extending (i. e. `KeyboardExtender` component)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant