Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: iOS 13 compilation issues #460

Merged
merged 1 commit into from
Jun 3, 2024
Merged

Conversation

kirillzyusko
Copy link
Owner

@kirillzyusko kirillzyusko commented Jun 3, 2024

📜 Description

Fixed iOS 13 compatibility.

💡 Motivation and Context

For projects that are targeting iOS 12.4 (for example react-native 0.72) textFieldDidChangeSelection method doesn't exist for UITextFieldDelegate.

To fix it I added @available annotation that takes the method into compilation only for iOS 13+.

Technically it's not very correct solution, because onSelectionChange will not be fired from my handler on iOS 12 - if we want to have this event we have to capture events from setter and forward it, but without subclassing it's pretty hard to achieve (only method swizzling as a last resort). But I don't want to spend too much time right now - if I get request that this functionality must be implemented for iOS 12, then I'll add it (otherwise I don't see a lot of sense in that right now, because RN already dropped minimal supported version, so I expect more and more people will move away from iOS 12 soon).

Closes #459

📢 Changelog

iOS

  • added a guard for textFieldDidChangeSelection (iOS 13+);

🤔 How Has This Been Tested?

Tested on CI.

📝 Checklist

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

@kirillzyusko kirillzyusko added the 🍎 iOS iOS specific label Jun 3, 2024
@kirillzyusko kirillzyusko self-assigned this Jun 3, 2024
Copy link
Contributor

github-actions bot commented Jun 3, 2024

📊 Package size report

Current size Target Size Difference
136525 bytes 136510 bytes 15 bytes 📈

@kirillzyusko kirillzyusko marked this pull request as ready for review June 3, 2024 10:33
@kirillzyusko kirillzyusko merged commit 8de40a6 into main Jun 3, 2024
12 checks passed
@kirillzyusko kirillzyusko deleted the fix/ios-13-compilation-issues branch June 3, 2024 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍎 iOS iOS specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Xcode 15.4 iOS version 13 or higher
1 participant