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
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 forUITextFieldDelegate
.To fix it I added
@available
annotation that takes the method into compilation only foriOS 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
textFieldDidChangeSelection
(iOS 13+);🤔 How Has This Been Tested?
Tested on CI.
📝 Checklist