uitextfield

how to handle backspace in uitextfield

纵然是瞬间 提交于 2019-12-11 07:32:10
问题 I have 6 uitextfield.And i did the autofocus. once user enter one value in one textfield.They will automatically redirect to next textfield. But i dont know how to handle the backspace .Like when user in last textfield and press backspace to delete the value..again they have to move to 5,4,3,2,1 respective textfields.How to do that ?? Here my code for autofocus : @IBAction func editing(_ sender: UITextField) { if sender == TextFieldOne { if sender.text?.characters.count == 1 { TextFieldTwo

When dismissing keyboard how do I keep my existing text fields in the same location?

狂风中的少年 提交于 2019-12-11 06:54:02
问题 So I have a UIScrollView that contains UITextFields and UILabels, and when the user clicks inside a UITextField the keyboard shows. But I need a way to allow the user to dismiss the keyboard and I was try to use the swipe down gesture to do it (as in Messages). I added the Gesture Recognizer to my view in the storyboard and added the Action to the header file. Here is the method: - (IBAction)SwipeKeyboardDown:(id)sender { if(self.moveTextField) { [self.moveTextField resignFirstResponder]; } }

Can't find keyplane that supports type 4 for keyboard error UITextfield focus

非 Y 不嫁゛ 提交于 2019-12-11 06:18:58
问题 I use UITextfield in custom cell . when I focus in my Textfield get this warning error : Can't find keyplane that supports type 4 for keyboard iPhone-Portrait-NumberPad; using 3876877096_Portrait_iPhone-Simple-Pad_Default what is this error??? 回答1: The issue is related to the NumberPad Keyboard Setting. Go to iOS Simulator-> Hardware-> Keyboard -> Uncheck the Connect Hardware Keyboard Option. This will fix the issue. 回答2: It seems like an Beta bug. I have a simmular problem with my Swift app.

Diffrence between textfieldshouldendediting and textfieldDidendediting in iPhone [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-11 05:55:37
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Diffrence between textfieldshouldendediting and textfieldDidendediting in iPhone What is the diffrence between textFieldShouldendEditing and textfieldDidEndEditing methods? and when will use these methods. 回答1: From documentation: textFieldShouldendEditing: This method is called when the text field is asked to resign the first responder status. This might occur when your application asks the text field to resign

Adding [myUITextField becomeFirstResponder]; does not bring up keyboard

女生的网名这么多〃 提交于 2019-12-11 04:30:47
问题 I've created a screen that has a UITextField on it. When I get a EditingDidBegin event, I resignFirstResponder, Bring up a Popover with another textField in it and for that TextField call the BecomeFirstResponder on it. When it runs, I get Blinking insertion pointer and the X clear contents. Though no Keyboard. The Master UIView is set to UserInteractionEnabled:YES. target action for First UITextField, its on its own view. [textField addTarget:self action:@selector(wantsToEditValue:)

UIAlertController utility class fails to call UITextField delegate or target but works in UIViewController

我怕爱的太早我们不能终老 提交于 2019-12-11 04:23:57
问题 I encountered a strange issue and maybe it is only a lack of knowledge about Swift 3.0 / iOS 10 so hopefully you can guide me into the right direction or explain to me what I'm doing wrong. HOW IT CURRENTLY WORKS I am trying to create a UIAlertController with style .alert so I can get a user text input for my app. My requirements are that the text must not be empty and if there was a text there before, it must be different. I can use the following code to achieve what I want: //This function

Regex for Name Only in UITextfield

雨燕双飞 提交于 2019-12-11 04:10:09
问题 I create below code for Regex for name that contain Alphabets only For Eg: John -Correct John123-Incorrect John 123 - Incorrect John Micheal -it shows incorrect as its have whitespace . How to fix it? -(BOOL)validateNameWithString:(NSString*)nameStr { NSString *nameRegex = @"^[a-zA-Z]*$"; NSPredicate *testRegex = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", nameRegex]; if(![testRegex evaluateWithObject:nameStr]) return NO; else return YES; } 回答1: Just add the whitespace token \s to

Deadlock when changing first responder from uitextfield to uitextview [iOS 7]

六月ゝ 毕业季﹏ 提交于 2019-12-11 03:38:56
问题 have a really strange problem here, this did not happen before iOS 7... i have a uitextfield and uitextview in a form that i created... the problem is that if the user has the textfield as first responder then taps on the uitextview a deadlock happens, memory will increase until the watchdog kills my app.. This does not happen when I change from uitextview to uitextfield Relevant code: #pragma mark - UITextView Delegate -(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange

Dynamic text fields in iPhone are possible or not?

故事扮演 提交于 2019-12-11 03:21:12
问题 I am trying to place textFields on iPhone screen dynamically but I am not getting an idea how to start it. I have to place a textField where ever the user taps. when a user tap on screen a text field or textView should be places there and user can write a comment over there. Is it possible? 回答1: Yes, it is indeed possible to add UITextField 's to a screen dynamically. A UITextField is just another view (albeit one that inherits from UIControl and then UIView ). After you create a UITextView

Select all text in UISearchBar on beginEditing?

一世执手 提交于 2019-12-11 02:56:22
问题 I’m trying to emulate the behaviour of the address bar in iOS Safari – that is, if there’s text in the address bar when it’s tapped, it is selected. Much in the same way most desktop browsers work, too. I don’t want to CLEAR it on selection, merely select what’s inside, so that if the user then begins typing, it’ll clear, but the user also has the ability to edit the existing string if they want to. I’ve tried the following, it finds the UISearchBarTextField inside the subviews under both