I'm trying to implement the transfer of a one-time code from SMS to the field above the keyboard, as in the image.
But for some reason the field above the keyboard is not displayed.
Code:self.valueTextField.textContentType = UITextContentTypeOneTimeCode;
UI hierarchy:
+UIView
CustomContentView
UIImageView
UITextField - valueTextField
UITextFieldContentView
I have read these materials:soQuestion and apple docs , and I saw a warning:
If you use a custom input view for a security code input text field, iOS cannot display the necessary AutoFill UI.
... but I do not understand what is meant by custom input view.
Also I have category for UITextField. Can it affect the work?
I will be glad to any ideas, thanks!
Okay. This is what I could find out. Regarding the code, it is enough that I described above. Additional settings on the client is not required. But you need to pay attention to the text of the SMS message. As an example, I attached two messages.
In the first message, our code is defined by the system as a phone number. We can even call it if we click on it. But why do we need to call a one-time code? :)
In the second image, the code is defined as one-time, just what we need. If we click on it, the system will offer to copy it to the clipboard.
What is the difference? Unfortunately, it is not completely clear by what rule the text is parsed in SMS. But we can check your text in the following way:
If you set a property textContentType to your text field and nothing works for you, the first thing you need to check is whether the operating system determines the code correctly. To do this, simply go to the message application and check the code:
blue font color with underscore - the system did not recognize
one-time code.
black font color (as default) with a gray underscore - it's okay!
At the end, in the first case, you should check the text of the message for the contents of incorrect characters.
PS Just a couple of examples of correct and incorrect SMS:
SMS-code: 12345 £ correct
SMS-code: 12345 $ correct
SMS-code: 12345 № correct
SMS-code №1: 12345 incorrect
I got caught out by the fact "Autofill PAsswords" was turned off on the phone.
It seems that it needs to be on for this functionaility to work.
Related
I've written LabView code for a locking system.
The lock has a motion timer that relies on input from a numeric control. I've added a script file reader that needs to be able to change that timer value. Using a selector, I can switch between values, but I'd like it to update the value in the control, rather than override it, so that I can see it on the screen.
How can this be accomplished?
This is currently how I switch between the scripted version and the direct numeric input from the control:
So how can I get the script value to update the control box or is that not possible...?
Do you mean something like this? I created a little vi to demonstrate how the control is updated.
In most cases "property nodes" are the way to go. Every control has a lot of different options to chose from and usually if you look through the properties you will find what you're looking for :)
A little hint:
If you want to add "code" to your question so that other users can test it, you can create a .png file. To do this, you need to select the parts of the vi that you want to share, and click on "Edit > Create VI Snippet from Selection". Then you save that generated .png and upload it here as a picture. Then others can drag&drop it into their block diagram.
Important: Check the .png before uploading and make sure that you're not accidentally posting sensitive data of your company.
I am new to objective C and I dont know if this can be done without any library or not but if yes kindly let me know...
I have a view in which I have added a button & textfield with some character like "A b # 1 6". Here I need to change the color of characters as I enter the password.
I mean to say when I enter T color or 'A' changes, p is pressed 'b' color changes and so on if I enter special character that color changes and minimum lenth is 6 so when I enter 6 character color of 6 changes.
I tried it with using regular expression but i need this functionality.
for refrence I am adding Image.
I have updated my code instead of labels I have taken Buttons to show the changes. Here is my code:
Now I want to know when user delete character from textfield the color should get back to normal color. I mean if user deletes "A" then button roundButtonCapital should change to normal button.
I hope I am clear. Please let me know if any doubt.
https://drive.google.com/file/d/0B3EymICOjqeNM01zcEQ4eUN0eUk/view?usp=sharing
Now I want to know when user delete character from textfield the color should get back to normal color.
At a guess when checking the user input you are only setting the color if the particular condition - uppercase, length, etc. - is met. You should always set the color, to the "passed" color if the condition is met and to the normal color if it is not. Do this on every change to the user input, addition or deletion, and your indicators will always be correct.
Note: You did not edit your question to include minimal code fragments, posting a link to a file is no substitute for this. You need to isolate the problem, which is what you should be doing anyway in trying to solve it, show the code for that issue in the question.
In this case you maybe could have include the code for a particular test - uppercase, digit, etc. - and explain what it was doing right and what didn't work. Maybe here because I don't know my answer is correct, it is a guess - to be sure I'd have to scroll through in detail 5 pages of code on a tablet I'm currently typing this on, essentially debug your code and that is not what Stack Overflow is here for.
You have help people help you, and show you've put effort in, or people just won't be willing to put in effort to help you.
That said, I hope the guess helps, and stick with SO asking and answering questions!
I really like how IntelliJ displays the information of the type of parameters that you are required to fill in as you are writing the code. The problem is that this info sometimes disappears if u click somewhere to check something etc. I never quite know how to get it to display that information again in same fashion. So I always spend some time to fiddle around until it displays that info again in the same fashion. I know you can hold down on ctrl and hover over the method name to bring up parameters information but its not quite the same and it then does not highlight on what parameter you are currently on. IntelliJ also brings up required parameters type of information when you are starting to go wrong. It brings up this big separate box and you can get very clear view of what needs to be done. I've taken a screenshot of the type of information that I'm on about. Both of them are on the same pic.
Please check it out.
My question: is there a way to bring this information up via keystrokes or mouse input at will? I've tried to google for an answer but I haven't had any joy. Please advise as I'm sure someone else might like this information too.
Thank you.
PS. I know that a good code does not usually have that many parameters but in my case there is not much that can be done.
Default shortcut for that is CTRL-P when cursor is inside the brackets.
I'm creating my own Text Editor in iOS using Core Text. Pretty much everything works great with one exception: Stuff really starts to slow down when the text document is "large". I've discovered that iOS is requesting the entire document text on every change, including selection changes (at least, when I notify the UITextInputDelegate of selection changes). Part of the problem is that I've already optimized my Core Text code by splitting up the document into paragraphs and rendering only the paragraphs that change. But doing this also split up the document string (which is a NSAttributedString) into the separate 'paragraph objects'. So when iOS requests the entire text document, I have to combine all those strings into one string, which takes time and memory.
My solution is to give iOS incorrect UITextPosition's for the beginningOfDocument and endOfDocument methods, limiting those positions to the paragraph(s) intersecting the current selection. This is actually working very well. iOS is now only requesting the current paragraph(s) of the change, which has completely eliminated the slow-down.
So far, so good, but I'm a little worried that this might break something. I've tested this a bit and nothing is broken, but Text Editors can be hard to test (who knows if it'll break in some edge condition).
I have 2 question:
Should iOS be requesting the entire document text on each change? If not, then perhaps some other method in my UITextInput protocol methods that are returning the wrong value, somehow causing iOS to request the entire document.
Does anyone know if this will actually break anything?
Alright, I've been testing this for quite a while now and I've finally found a place where using this technique will break functionality. UITextInput uses beginningOfDocument and endOfDocument to determine whether it has room to "move" when you press the arrow keys on a bluetooth keyboard. Returning only the beginning and end of the currently selected paragraph(s) cause it to ignore the 'arrow' buttons when it is at the beginning or end of that paragraph and those arrows indicate an attempt to move outside what it thinks is the beginning/end of the document. It's easy enough to fix. If the currently selection begins at the beginning/end of a paragraph, I now also return the previous/next paragraph as part of the document, respectively.
I've created a UITextView and set the autocapitalization property to UITextAutocapitalizationTypeSentences or to UITextAutocapitalizationTypeWords. Both settings work as expected except for the first word that is typed, which is not autocapitalized! It is autocapitalized if the user deletes the text taking the cursor back to the start of the line.
My workaround would be to convert the first letter from uppercase to lowercase in the UITextView delegate method textView:shouldChangeTextInRange:replacementText:.
The only tiny issue that remains is that the user is unable to tap on the shift key to prevent the first word from capitalizing.
Do other people experience this issue and is this what you've done?
Thanks.
I think this may be an issue with the simulator. It seems to be working fine on the device!