Questions tagged [uitextfield]

A UITextField object is a control that displays editable text and sends an action message to a target object when the user presses the return button. You typically use this class to gather small amounts of text from the user and perform some immediate action, such as a search operation, based on that text.

A UITextField object is a control that displays editable text and sends an action message to a target object when the user presses the return button. You typically use this class to gather small amounts of text from the user and perform some immediate action, such as a search operation, based on that text.

In addition to its basic text-editing behavior, the UITextField class supports the use of overlay views to display additional information (and provide additional command targets) inside the text field boundaries. You can use custom overlay views to display features such as a bookmarks button or search icon. The UITextField class also provides a built-in button for clearing the current text. A text field object supports the use of a delegate object to handle editing-related notifications.

Resources:

8508 questions
3
votes
1 answer

How to present a view controller when a text field is tapped?

I have a view with two UITextField controls, one to let the user to set a start date and another to set an end date. I'd like to present modally a view with a calendar to pick a date when a text field is tapped, instead of its default behavior of…
3
votes
2 answers

How do I detect if keyboard is currently shown, if I transitioned from another view controller that was already showing the keyboard?

I have a view controller that makes a UITextField firstResponder on ViewWillAppear. Normally I could just rely on a UIKeyboardWillShow notification to detect if the keyboard has shown, but this won't trigger if I came into the current view…
Vadoff
  • 9,219
  • 6
  • 43
  • 39
3
votes
1 answer

iOS 9 UITextField textRectForBounds issue

I am running on iOS 9, XCode 7 GM. I have a class that extends UITextField (CustomOffsetTextField) and provides support for custom text positioning like so: override func textRectForBounds(bounds: CGRect) -> CGRect { return CGRectOffset(bounds,…
Reid Conner
  • 223
  • 1
  • 3
  • 7
3
votes
0 answers

iOS Text Selection Magnifying Glass Color?

In testing, I discovered the "magnifying glass" color for text selection in a view of my app is black, instead of being the normal magnifier. I have no idea why this is, I don't believe I set it. How can I change this back to the standard…
Crake
  • 1,661
  • 1
  • 13
  • 30
3
votes
1 answer

NSCFNumber rangeOfCharacterFromSet Error Parse

I'm getting this error when going to a view controller on my TabBarController: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber rangeOfCharacterFromSet:]: unrecognized selector sent to instance…
user4203956
3
votes
1 answer

NSNotification for single object in swift

I have two text fields, topTextField and bottomTextField, at the top and bottom of the screen, respectively. bottomTextField hides behind the virtual keyboard when it comes up so to fix that I'm using NSNotification to listen for the virtual…
twp
  • 31
  • 3
3
votes
1 answer

How to get the textvalue of each dynamically created row in UITableView in swift

As shown in below image,i created a prototype cell with label and textfield in tableviewController. Each row is created at runtime as shown below. When user clicks SAVE button all the details like Course detail,Registration id, Username and…
sia
  • 1,872
  • 1
  • 23
  • 54
3
votes
1 answer

How to enable or disable the keyboard return key

When we enter character in textfield then it is enabling the return key. But in our requirement we need to enable the return key when length is more than 5. But now as soon as we enter character it is enabling the return key. Do we need to customize…
ankit kumar
  • 55
  • 1
  • 3
3
votes
4 answers

Make a UITextField active on load

I have an app that only has one text field and I want that text field active with the keyboard active when the view loads. Is there any way to force it? James
Dark Templer
  • 277
  • 5
  • 10
3
votes
2 answers

Typing always (force) lowercase or uppercase - iOS swift

How to force to type always lowercase or uppercase for some textfields in swift language?
fatihyildizhan
  • 8,614
  • 7
  • 64
  • 88
3
votes
0 answers

NSAttributedString with image doesn't work in UITextField?

I'm inserting an image into an NSAttributedString with the following solution: https://stackoverflow.com/a/20930656 I've been able to get this working in a UITextView, but for some reason it doesn't work in a UITextField. Any ideas? Thanks
user339946
  • 5,961
  • 9
  • 52
  • 97
3
votes
3 answers

UITextField resign first responder iOS4

I have a simple piece of code that works on every system except iOS4. It's about resigning first responder for a UITextField. The text field is all wired up, and here's the code for the delegate: - (BOOL)textFieldShouldReturn:(UITextField…
dusker
  • 580
  • 3
  • 11
3
votes
1 answer

Issue with UITextField's leftView property

I am trying to add a single blank UIView to multiple UITextField in order to give a little padding. But my app freeze (does not crash). Can anyone tell me what the issue might be? Here is my code. var paddingView = UIView(frame: CGRect(x: 0, y: 0,…
Saqib Omer
  • 5,387
  • 7
  • 50
  • 71
3
votes
1 answer

Saving an instance of a ViewController

I have a program in which the user will enter data in one view controller and the information is calculated in another. I've gotten to the point where I can enter the data and when I segue to the SecondViewController I can access my data. But when I…
K-Poch
  • 33
  • 5
3
votes
1 answer

Format Phone Number Real-Time using NBAsYouTypeFormatter

I have searched all over the place and I have seen many solutions to this, but most of it are really being "hackish" and error prone. I am trying to format the phone number on UITextField using the libPhoneNumber iOS Class…
JayVDiyk
  • 4,277
  • 22
  • 70
  • 135