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
39
votes
11 answers

iPhone Force Textbox Input to Upper Case

How do I force characters input into a textbox on the iPhone to upper case?
hungbm06
  • 1,549
  • 6
  • 24
  • 32
39
votes
10 answers

How can I restrict special characters in UITextField except dot and underscores?

How can I restrict special characters in a UITextField except dot and underscores? I have tried the code snippet below, but without luck: #define ACCEPTABLE_CHARECTERS @" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_." -…
Graham Bell
  • 1,139
  • 1
  • 14
  • 30
38
votes
7 answers

Moving Onto The Next UITextField When 'Next' Is Tapped

I have an iPad application which has a sign up form within it. The form is very basic and contains only two UITextFields which are for Name & Email address. The first TextField is for the candidates Name, When they enter their name in and press…
Paul Morris
  • 1,763
  • 10
  • 33
  • 47
38
votes
7 answers

How to scroll view up when keyboard appears?

I know that this question has been asked over and over again, but nothing seems to be working for me. Most of the solutions around are pretty out of date, and the rest are incredibly huge blocks of code that are ten times larger then the actual…
Henry F
  • 4,960
  • 11
  • 55
  • 98
38
votes
12 answers

iOS/Swift: how to detect touch action on a UITextField

I would like to detect the touch action on a UITextField. It seems the "Touch Up Inside" action is not fired by touching inside the textfield.
Daniele B
  • 19,801
  • 29
  • 115
  • 173
38
votes
2 answers

UITextField -webView no longer supported

I get the below debug output when working with some text fields. UITextField -webView called. This method is no longer supported with the new text architecture Can someone explain why this is appearing? I am currently running XCode 5 with iOS 7
LanceJeffrey
  • 452
  • 5
  • 8
36
votes
1 answer

SwiftUI - State change in UITextField causes the frameWidth to grow uncontrolled and ignore bounds/frame

I am using SwiftUI and bridge to UITextField (I need to assign firstResponder). I use the code from here: SwiftUI: How to make TextField become first responder? The following code updates my @Binding var. This of course is intended behavior. The…
denninho
  • 473
  • 4
  • 7
36
votes
5 answers

iPhone datepicker instead of keyboard?

How would you do that? I have a form with a UITextField. When I click in it I would like to display a UIDatePicker instead of the default Keyboard that pops-up by default? Note that there are also other elements on my form.
xpepermint
  • 35,055
  • 30
  • 109
  • 163
36
votes
6 answers

Format UITextField text without having cursor move to the end

I am trying to apply NSAttributedString styles to a UITextField after processing a new text entry, keystroke by keystroke. The problem is that any time I replace the text the cursor will jump the very end on each change. Here's my current approach…
Bernd
  • 11,133
  • 11
  • 65
  • 98
35
votes
4 answers

IOS: action with enter key of iPad KeyBoard

I have two textfield, in first textfield I write "Hello" and when I push enter in iPad keyboard, I want that in second textfield appear "World"; How can I use enter to create an action in my application?
cyclingIsBetter
  • 17,447
  • 50
  • 156
  • 241
35
votes
3 answers

Strong password overlay on UITextField

I faced with strange overlay on UITextField. I'm using field of type textContentType = .password and isSecureTextEntry = true. I have also eye button to unhide password characters with changing isSecureTextEntry = false. When I do that my password…
MarcinR
  • 786
  • 1
  • 6
  • 16
35
votes
18 answers

UITextField has trailing whitespace after secureTextEntry toggle

I have a button that toggles between Show/Hide mode (i.e. toggles a UITextField between secureTextEntry NO and YES). The purpose of which is to allow the user to see the password they are entering. I followed the example (with the highest number of…
Brian Colavito
  • 881
  • 2
  • 9
  • 19
35
votes
4 answers

what is the difference if i return "YES" or "NO" when i call textFieldShouldReturn

This is the text field delegate method but i have doubt about return type -(BOOL)textFieldShouldReturn:(UITextField *)textField { [textField resignFirstResponder]; return NO; } and this is the same method with different return…
iKushal
  • 2,689
  • 24
  • 20
34
votes
4 answers

Class _PointQueue is implemented in both when I click on textfield... How can I resolve this issue?

I'm using xcode 13 and making a demo on coredata. objc[6188]: Class _PathPoint is implemented in…
iFateh
  • 570
  • 2
  • 6
  • 22
34
votes
10 answers

textFieldShouldReturn not being called in iOS

We're trying to figure out how to get the keyboard to hide, but we're having problems getting the textFieldShouldReturn to fire. Why? This is what has been done: *.h @interface MultiSalesViewController : UIViewController…
iPhone Developer
  • 519
  • 3
  • 6
  • 10