How to please get rid of a character Partial Line Forward which gets generated on iOS 12 device by clicking on default keyboard on Continue button when entering text into a Text Field? Classic trim function doesn't catch it. It is a nearly invisible character and it causes all regexes for email (yes, it is on an email entry Text Field) to fail. We have fixed it by changing handling of the Continue button, but I wanted to post it here for others and I am really interested in how to get rid of it. Thanks.
-
What exactly does the string contain? `print(text.debugDescription)` helps. – Martin R Oct 24 '18 at 08:18
-
For clarification, please see example (the character is between . and com, when you copy it into a text editor and go over the string using keyboard arrows it stops there): name@patonce.com – Ondrej Plevka Oct 24 '18 at 08:43
2 Answers
Clicking on the iOS keyboard, on the Continue button after typing text into a Text Field does not add a new character to your already typed text. I believe you have something else appending this character.
Maybe I didn't understood your question.
The resulted printed text is name@patonce.com

- 4,649
- 2
- 27
- 47
-
Unfortunately, it does add it newly on iOS 12. Please see example (the character is between . and com, when you copy it into a text editor and go over the string using keyboard arrows it stops there): name@patonce.com – Ondrej Plevka Oct 24 '18 at 08:19
-
I am trying to reproduce this and I cannot do it on a simulator or on a device. I will update my answer with a short gif so you can tell me what am I missing. I can also see that the email you provided has this character but I am still holding the ideea that this character gets inserted by something else, not the OS. – Durdu Oct 24 '18 at 08:27
-
@OndrejPlevka I have updated the response to aid in understanding this issue better – Durdu Oct 24 '18 at 08:34
-
I am sorry, it is not easy to reproduce it. Only version on TestFlight does that on iOS 12 iPad, once we run it from XCode, it, I don't know why, stops doing this. The reason I wrote it is, that it failed our AppStore review multiple times because of this. – Ondrej Plevka Oct 24 '18 at 09:20
Ok, we have fixed it by replacing the specific character with empty string plus improving the handling of the Continue/Enter button. I wanted to post it here to help others who might be searching for it, because there is no question like this. It was somehow generated by a person at Apple doing a review and it took us quite some time to find this. Please see example (the character is between . and com & after @, when you copy it into a text editor and go over the string using keyboard arrows it stops there): name@patonce.com

- 1
- 2