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

Calling resignFirstResponder doesn't work within overrides firstResponder

How to focus activated UITextField with UIResponder? Code below: // customTextField.swift import UIKit class customTextField: UITextField { override func becomeFirstResponder() -> Bool { if self.tag == 1 { self.borderStyle = .Line …
vcvcvcvc
  • 137
  • 4
  • 10
3
votes
1 answer

Yet another iphone memory leak cry for help. Looking for advice on next steps

I hate having memory leaks and usually pride myself on, blah, blah, blah. Help! The leaks I have aren't crazy big (a few K at max), but I want to remove them for sure. There are two categories of leaks and I've got some screen shots of each from…
VTPete
  • 361
  • 1
  • 12
3
votes
1 answer

How to test UITextField in Xcode UI Testing when the text field is empty?

I am making a UITest in Xcode. When I record my test it works fine but when I run the test, it gives an error. These are the lines of code where the error occurs: XCUIElement *clearTextTextField = [app.textFields containingType:XCUIElementTypeButton…
Anuj Kalra
  • 73
  • 1
  • 8
3
votes
6 answers

How to allow only certain set of numbers in a UITextfield in swift 2.0

I am having a UITextField in which i get the month number as input. I am successful in limiting the no of characters to 2 in the UITextField. But i want users to enter only the values from 1 to 12 and none other than that. This has to be done…
Kautham Krishna
  • 967
  • 1
  • 14
  • 33
3
votes
2 answers

tvOS UITextField blank after editing

Editing UITextField in tvOS shows a new view where the user can enter in text, and when text entry is done, the user is returned to the previous view. However, I have found that when I return from the text editor, the text I edit does not show up in…
n_b
  • 1,116
  • 1
  • 11
  • 20
3
votes
3 answers

How to create autocomplete[real time] text field in iOS, which provides suggestions as you type

I'm working on a app. it has texfields.What I want is when user type something in the textfield("as an exmple think user types letter 'y'") then below the text field , should show realtime all available names in start from 'y' as dropdown list. then…
Jobs
  • 269
  • 2
  • 6
  • 21
3
votes
1 answer

Is it possible to add target method for the delete key on the number pad?

I am using number pad for my UITextField's. I have set the delegate for my textfields. I used the required delegate methods to handle the different events. But I am unable to capture the event when user taps on x mark on number pad when a textfield…
Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
3
votes
3 answers

Dynamic searching in tableview in iOS

I've a tableview and text field where I've implemented search method. Right now, when I write some value in textfield and click search button, then it search in the tableview. But, I want it to be dynamic means the moment I start typing in textfield…
Nilesh Jha
  • 1,626
  • 19
  • 35
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
3 answers

Hiding the keyboard when UITextField loses focus

I've seen some threads about how to dismiss the Keyboard when a UITextField loses focus, but it did not work for me and I don't know how. The "touchesBegan:withEvent:" in the following code, never gets called. Why? - (void)touchesBegan:(NSSet…
jcborges
  • 1,064
  • 2
  • 10
  • 13
3
votes
1 answer

Terms and Conditions View Controller for iOS

I was trying to make a simple Terms and Conditions view controller for my app. I was figuring a ScrollView with a Text Field. What I am running into is displaying a really long formatted text string with multiple line feeds and quoted words and…
lr100
  • 648
  • 1
  • 9
  • 29
3
votes
0 answers

Cannot change UITextField inputView frame size

I have a custom keyboard for a UITextField using the inputView. I can switch over to the native keyboard again, at which point the height of the keyboard can change (e.g. swiping up/down on autosuggest, changing keyboards). This is why my custom…
Ken Ko
  • 1,517
  • 2
  • 15
  • 21
3
votes
3 answers

UIKeyboardWillShowNotification calling twice ios 9

I am using UIKeyboardWillShowNotificationto detect when a textfield is selecting by user and the keyboard is opening. In ios 8 and older versions of iOS it is working fine but today I upgrade to iOS 9 and xCode 7. the problem is that in iOS now the…
Husein Behboudi Rad
  • 5,434
  • 11
  • 57
  • 115
3
votes
3 answers

iPhone -- getting the adjusted font size of a UITextField

I have a UITextField with the adjustsFontSizeToFitWidth property set to YES. I want to get ahold of the current (adjusted) font size. Is that possible? If not, getting ahold of the actual width of the text (in the adjusted size) would be almost as…
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
3
votes
3 answers

Adding UITextField inline UILabel (Fill in the blanks)

I am trying to achieve something like this for iOS in Objective C. The fill in the blanks(UITextField) should be inline, and should be able to have its own inputType. Also, each View is a type of cell.contentView of a UITableViewCell. My current…
Dheeraj Jami
  • 190
  • 2
  • 14