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:

549 questions
-2
votes
2 answers

UITextField shouldChangeCharactersinRange as external function

I want to validate UITextField input for multiple view controllers. The following works: validate.h #import @interface validate : UITextField @end validate.m #import "validate.h" @implementation…
Ancient
  • 73
  • 4
-2
votes
1 answer

How to pass data back to ViewController holding Container View and TableViewController that is embedded in the Container? Swift 3

How can I call func checkField when nextButton is tapped? If no field is empty in ManagedTableEleventhViewController, I'd like to segue to TwelvethViewController. I have a UIViewController ElevethViewController which holds a container view. The…
bibscy
  • 2,132
  • 1
  • 19
  • 61
-2
votes
4 answers

iOS textFieldShouldReturn not running

I've created this in my .h: @interface Class : UIViewController
user2408952
  • 1,899
  • 4
  • 22
  • 25
-2
votes
2 answers

weird error when finish editing UITextField

This is what I get when I press the done button on the keyboard of a UITextField: (code to follow) 2013-10-14 23:22:55.170 What to where?[21627:a0b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI…
donkey
  • 1,300
  • 13
  • 28
-3
votes
1 answer

How to format a textfield so when user inputs data its in format similar to 80/150?

Currently there is a textfield that after a user enters data it has to post to a server in a format similar to 60/500, so basically a fraction. I'm familiar with setting up a textfield and connecting it via storyboard along with setting up text…
SwiftyJD
  • 4,091
  • 6
  • 33
  • 79
-4
votes
2 answers

Thread 1: signal SIGABRT swift

I was trying to center the text in the middle of a view, but instead, received an error. Here's my code as a reference. let textbox = UITextField() textbox.text = "Hello" textbox.sizeToFit() textbox.centerXAnchor.constraint(equalTo:…
Claire Cho
  • 57
  • 1
  • 11
-4
votes
1 answer

How to unwrap textfield.text without using the " ! " - Swift 3

I've been searching stackoverflow and would like to know what the best practice is to unwrap the textfield.text optional without force unwrapping. It works doing this, but I've been told to never force unwrap. But when I assign textfield.text to…
-4
votes
1 answer

Swift code that will print a string of all the characters of a new word typed in a UITextView as they are being typed

I need help with swift code or function that will run in the body of UITextView function textViewDidChange that will print a string of all the letters of a new Word as they are being typed in a UITextView control. So if I have a UITextView…
-5
votes
2 answers

how to call this function in swift?

I have this function but the problem is I don't know how to call this function on super.viewDidLoad func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool { if let…
Indra Sen
  • 101
  • 1
  • 9
-5
votes
3 answers

Swift : Move from one textfield to another

There is a scenario when user enters two character in textfield then focus should move to next textfield. Below is code that I have used : func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString…
Jayprakash Dubey
  • 32,447
  • 16
  • 161
  • 169
1 2 3
36
37