fix: KeyboardExtender on iOS 26 with round corners#1067
Merged
kirillzyusko merged 4 commits intomainfrom Aug 9, 2025
Merged
Conversation
Contributor
📊 Package size report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Added rounded corners to
KeyboardExtenderon iOS 26 to match Apple guidelines.💡 Motivation and Context
We need to specify
cornerConfigurationproperty. 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 userespondTo- 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, thenKeyboardExtenderwill not be visible at all - we'll try to use unexisting class and will not create a view, but since base class isUIInputViewwe'll get something like this: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
canImportdirective - 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
#if canImport(UIKit.UIGlassEffect)theUIGlassEffectusage.🤔 How Has This Been Tested?
Tested manually on iPhone 16 Pro (iOS 26.0, 18.5).
📸 Screenshots (if appropriate):
📝 Checklist