-
Notifications
You must be signed in to change notification settings - Fork 522
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
[release/6.0.4xx-xcode14] [UIKit] Change UITextInput.SelectedTextRange to not be ArgumentSemantic.Copy. Fixes #15677. #16278
Conversation
…ic.Copy. Fixes dotnet#15677. When a property is declared as ArgumentSemantic.Copy, we'll copy the input value in property setters. Unfortunately this makes UIKit crash, because for UITextField.SelectedTextRange UIKit might use a custom UITextRange subclass, with a broken 'copy' implementation (doesn't copy all the fields), that subsequently makes the app crash. On the other hand, UITextRange doesn't conform to NSCopying, and as such is in theory not necessarily copyable, and thus I believe the bug is really that the property is declared as a 'copy' property. Fixes dotnet#15677.
❌ [PR Build] Tests on macOS Mac Catalina (10.15) failed ❌No test package could be found for tests on macOS Mac Catalina (10.15) Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌No test package could be found for tests on macOS M1 - Mac Big Sur (11.5) Pipeline on Agent |
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🔥 [CI Build] Test results 🔥Test results❌ Tests failed on VSTS: simulator tests 0 tests crashed, 1 tests failed, 159 tests passed. Failures❌ mtouch tests
Html Report (VSDrops) Download Successes✅ bcl: All 59 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Test failures are unrelated (https://github.com/xamarin/maccore/issues/2620). |
When a property is declared as ArgumentSemantic.Copy, we'll copy the input value in property setters.
Unfortunately this makes UIKit crash, because for
UITextField.SelectedTextRange UIKit might use a custom UITextRange subclass,
with a broken 'copy' implementation (doesn't copy all the fields), that
subsequently makes the app crash.
On the other hand, UITextRange doesn't conform to NSCopying, and as such is in
theory not necessarily copyable, and thus I believe the bug is really that the
property is declared as a 'copy' property.
Fixes #15677.
Backport of #16201