-
Notifications
You must be signed in to change notification settings - Fork 11
Remove code targeting iOS 12 or lower #625
Remove code targeting iOS 12 or lower #625
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the cleanup of the code that's for versions of iOS earlier than 13 looks good. It's also in-line with the main intent behind the PR.
I'm not so sure about the change from onChangeSelectionHandler to textFieldDidChangeSelection, for a few reasons:
- This goes beyond cleaning up code that's not used anymore, as it's modifying live code.
- Tracking
editing-changedis not semantically equivalent to trackingselection-changed. While both may coincidentally work for us, the first type of event is what we're aiming to track. As an example: I can triggertextFieldDidChangeSelectionby moving the caret around in the text field, but that shouldn't result in a call tohandleEmailFieldDidChange. - And last but not least: this code is a bit of a critical part of our Apps, and the pre-existing code works well. I'd be wary to make changes that could introduce problems.
Let me know what you think.
|
@diegoreymendez Well the motivation behind these changes were based on a comment I found in the code, it felt like this was the original intent for whoever wrote this part.
However I feel that your concerns are totally valid, these changes do diverge from the current task at hand. So will revert them 👍 |
|
Thanks @hassaansaleh: that comment perfectly explains the direction you took in the PR. Also thanks for understanding and rolling the code back. |
diegoreymendez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is good to go, nice work! :)
01b3f61
into
wordpress-mobile:feature/remove-1password-framework-usage
Description
There was some code targeting iOS versions prior to iOS 13. And since the deployment target is iOS 13, these instances can safely be removed. This PR removes these instances. The changes in this PR introduces no visible changes, it's more of a cleanup.
The changes include:
@availableandif #availableinstances.RefactoringGravatarEmailTableViewCellandTextFieldTableViewCellto removeonChangeSelectionHandlerand instead depend onUITextFieldDelegatemethodtextFieldDidChangeSelectionwhich is available staring iOS 13.References: wordpress-mobile/WordPress-iOS#17516
Testing
To test this use the WordPress iOS App, but make sure to replace this line in the Podfile
pod 'WordPressAuthenticator', '~> 1.42.1'With this
pod 'WordPressAuthenticator', :git => 'https://github.com/hassaansaleh/WordPressAuthenticator-iOS.git', :branch => 'issue/17516-remove-iOS12-code'What to test
Check that interacting with textfields is working correctly in the following screens:GetStartedViewControlerPasswordViewControllerSiteCredentialsViewControllerSiteAddressViewControllerFor PasswordViewController, check when the email is changed from a Password Manager, that it's handled correctly.