Questions tagged [uitextfielddelegate]

The methods declared by the UITextFieldDelegate protocol allow the adopting delegate to respond to messages from the UITextField class.

The methods declared by the UITextFieldDelegate protocol allow the adopting delegate to respond to messages from the UITextField class. On UITextFieldDelegate, you can find the following methods:

Managing Editing

– textFieldShouldBeginEditing:

– textFieldDidBeginEditing:

– textFieldShouldEndEditing:

– textFieldDidEndEditing:

Editing the Text Field’s Text

– textField:shouldChangeCharactersInRange:replacementString:

– textFieldShouldClear:

– textFieldShouldReturn:

574 questions
3
votes
0 answers

How to change UITextField RightView size?

I trying put to 2 items in rightView component. for example;` let label = UILabel(frame: CGRect(x: -80, y: 0, width: 100, height: 50)) let rightView = UIView(frame: CGRect(x: 100, y: 100, width: 200, height: 100)) label.text = …
3
votes
1 answer

What is the default behavior for a UITextField Return Button?

I am relatively new to iOS programming, and have been curious about a pretty common UITextField delegate function. In the developer documentation for optional func textFieldShouldReturn(_ textField: UITextField) -> Bool it states: Return Value true…
D. Pratt
  • 444
  • 8
  • 15
3
votes
1 answer

Correct behavior of shouldChangeCharactersIn method, the delegate of UITextFieldDelegate

There two UITextField (email, password) in the Login/SIgnup controllers in my code (here is the example), so that users obviously could insert login/password to register/log in. In the method shouldChangeCharactersIn I check the data inserted by…
adnv
  • 101
  • 2
  • 6
3
votes
3 answers

How UITextField move to next TextField When Click on Return Key in Keyboard

I am using this code to move UITextField and it is working but I am not happy with this code and I want (when I click return key Then Cursor move to next UITextField) this function in my registration or login form anybody can suggest me. func…
3
votes
0 answers

UITextField auto-completion callback

I am using a library for field validation which relies on UITextFieldTextDidChangeNotification. It simply validates fields in a form when this notification gets fired and sets a form state (like invalid, eligible, submittable). However, when I…
3
votes
2 answers

Changing the return key type while still editing UITextField?

IM having an issue with changing the return keys type while still editing the textfield of my view. So when the user clicks the textfield i have a few checks that change the return type of the keyboard, these checks are placed in -…
Esko918
  • 1,397
  • 1
  • 12
  • 25
3
votes
1 answer

Subclassing UITextField with self.delegate causes app to freeze, CPU spikes to 100%

I have a subclass of UITextField which sets self.delegate = self. The subclass is used to prevent special characters being entered into a UITextField. At first it works fine, but after a few keys are pressed the CPU spikes to 100% and freezes the…
rosshump
  • 370
  • 1
  • 4
  • 21
3
votes
3 answers

resignFirstResponder not getting called inside textFieldShouldClear

I am trying to implement search bar in one of my page. I am not using regular search bar due to its design. What I have is as below. UIImageView above UIView (textfield background) UITextField above UIImageView (textfield) I am using delegates for…
Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
3
votes
2 answers

Unable to use backspace key to delete a character from a textfield in iOS

I am implementing the following delegate method for UITextField: - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSString *integerPart = [textField.text…
syedfa
  • 2,801
  • 1
  • 41
  • 74
3
votes
4 answers

UIPickerView as inputView, but disallow direct editing

So I have UIPickerView as inputView for one of my text fields. It works perfectly: it slides up, as normal keyboard would, I can select an option and it will be populated in a text field. The only problem is that I can directly edit the field, by…
3
votes
3 answers

How to show keyboard upper side of UItextfield when we enter text, in iphone?

I have a UITextfield in which I am entering value. I don't want to scroll myself or adjust keyboard myself , I want Keyboard automatically adjust itself when I enter text in UITextfield and always show below the textfield. Any hints from experts…
Areeba Khan
  • 264
  • 1
  • 2
  • 9
3
votes
2 answers

resignFirstResponder crashes while using UITextField in custom UlTableViewCell

I am getting an intermittent crash on my application. Crash log makes me think that there seems to be some issue the way UITextField's resignFirstResponser is being called. I am using UITextField and UITextFieldDelegate protocol methods in my custom…
Vik Singh
  • 1,563
  • 2
  • 19
  • 36
2
votes
2 answers

textFieldDidEndEditing firing "too late"

I have a multiview process the user is entering in data and I'm saving it to the model class properties each step along the way. I use textFieldDidEndEditing to check if the input is valid, and if so, saves the entered data. On the view I have a…
jaySF
  • 94
  • 1
  • 10
2
votes
1 answer

IOS textFieldDidChange when outlet in other class

I've got a specific iOS question when accessing an outlet on a different class. In my project I have a UItableView with custom tableViewCells which I have created using the interface builder. These cells have UItextfields on them and I need to know…
2
votes
1 answer

Synchronously slide up UIView and resize UITableView when UITextField is fired

I would to resize a UITableView and slide up a UIView that contains a UITextField when this field is fired. These are two simple mockups: Now I have this code: - (void)textFieldDidBeginEditing:(UITextField *)textField { [UIView…
Fred Collins
  • 5,004
  • 14
  • 62
  • 111