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
4
votes
4 answers

Modal View Issue

I have an issue with some of my views, here is a breif outline of my setup: Tab Bar Controller | --View Controller 1 | --View Controller 2 | --View Controller 2 On a certain action, View Controller 1 will display a modal dialogue. Within this…
4
votes
2 answers

Move view when so that keyboard does not hide text field

In my app, when I click on a text field, the keyboard hides it. Please help me -- how can I move my view up when I click on the text field. I'm using this code in textFieldDidBeginEditing: self.tableView.scrollIndicatorInsets = UIEdgeInsetsMake(0,…
sandy
  • 1,908
  • 3
  • 19
  • 23
4
votes
1 answer

How to set delegate of UITextField in separate class in Swift?

I'm trying to implement UITextFieldDelegate in separate class, but it didn't working: class ViewController: UIViewController { @IBOutlet var TextField: UITextField! override func viewDidLoad() { super.viewDidLoad() let…
JasonTW
  • 55
  • 8
4
votes
1 answer

How to change empty spaces length between characters on UITextField

I am trying to create spelling app but i stuck. User going to listen some word and will try to write it. i am trying to insert underline seperately to every characters on UITextField. Every underline will give a hint to user that how many characters…
Yucel Bayram
  • 1,653
  • 2
  • 22
  • 41
4
votes
3 answers

UITextField: Password Implementation

I have a OTP Screen, where I have to enter the OTP in 4 digit password in 4 Diff TextFields, The scenario is like this : A max character limit for each textfield is 1 and when the user enters a character in textfield it should move to next…
Deepakraj Murugesan
  • 1,195
  • 11
  • 30
4
votes
2 answers

Limiting characters on UITextField breaks Emojis, can only add one and not delete

I'm using the following code to limit the amount of characters that can be in a UITextField public func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { let…
Hobbyist
  • 15,888
  • 9
  • 46
  • 98
4
votes
3 answers

Runtime Attribute of UITextFiled

I have so many UITextField in my App. I don't want to allow user to enter special characters those textfields. I know, I can use shouldChangeCharactersInRange delegate method of UITextFiled and validate it, But this approach is feasible for 5-8…
Er.Shreyansh Shah
  • 1,482
  • 1
  • 9
  • 29
4
votes
2 answers

UITextFieldDelegate crash (exc_bad_access)

Looks like I have a problem with UITextFieldDelegate. I just created a view controller that responds to UITextFieldDelegate protocol, and easily added the field to the xib, then set delegate field...you know. But when I trying to press the field (to…
KaronatoR
  • 2,579
  • 4
  • 21
  • 31
4
votes
3 answers

How to insert a string automatically while user editing UITEXTFIELD

I want to my uitextfield be like XXX.XXX.XXX/XX at the end of typing. To limit the lenght I use this: - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { if (textField…
Marckaraujo
  • 7,422
  • 11
  • 59
  • 97
4
votes
1 answer

Mirror text from UITextField on inputAccessoryView - UIToolBar to text on UITextField on navigationController.toolbar

In my app I have a UITextField on the navigationController toolbar. #import "ViewController.h" @interface ViewController () @property (nonatomic,strong) NSArray *toolBarButtonItems; @property (nonatomic,strong) UITextField *textField; @property…
denvdancsk
  • 3,033
  • 2
  • 26
  • 41
4
votes
1 answer

UItextView delegate not called using custom keyboard

I have several UITextView subviews, all using the same custom input interface (basically a numberpad with an autofill-option and a save button). My problem is that the delegate method shouldChangeCharactersInRange: is not called when the textfield's…
user1702623
  • 235
  • 3
  • 6
3
votes
7 answers

iPhone: UITextField End Editing event doesn't hide keyboard

I want to hide keyboard on UITextField end editing event but somehow I am not able to get following code working! When I press Done button, it hides the keyboard but not when I don't press done button and move to another UITextField where I don't…
Paresh Masani
  • 7,474
  • 12
  • 73
  • 139
3
votes
2 answers

UITextField crashes if changing text in editing changed

I wrote a simple ios5 application (includes garbage collector) that has a single view and a UITextField I need to analyze input text in this UITextField here's my code. header file: #import @interface ViewController :…
Oleg
  • 1,383
  • 4
  • 19
  • 35
3
votes
1 answer

Enable UIButton if UITextField is not empty in IPhone app

In my app, i have two textfields(username and Password) and UIbutton in SignIn page. I want to enable button if textfield(password) having text. I have created the UITextfield and UIbutton with below property in viewDidLoad(). …
user2136
  • 791
  • 1
  • 11
  • 26
3
votes
1 answer

UITextField Custom InputView - How do I get textFieldShouldReturn to fire?

I have created a custom inputView and have a Done button. Does anyone know how I can wire the done button up to work the same as a return key on the built in keyboard. I basically need to get the textFieldShouldReturn method to fire for a…
Craig Mellon
  • 5,399
  • 2
  • 20
  • 25