As of May 31, 2023, we have updated our Code of Conduct.

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.

Filter by
Sorted by
Tagged with
0 votes
0 answers
8 views

Remove dictation button when ucing cutom keyboard in swiftUI

I am using custom keypad in my app. Its UITextView wrapped in UIViewRepresentable and used in swiftUI. I get this dictation button and I would like to get rid of it. I tried some hacks I have seen in ...
beowulf's user avatar
  • 536
0 votes
1 answer
65 views

How-to: UITextField wait until user stopped typing

I'm trying to find the best way to handle this. I'm currently looking to wait until user stops typing (let's say delay 3s) before running some code. Initially I was going to use textFieldDidEndEditing ...
Ace Green's user avatar
  • 373
0 votes
1 answer
71 views

UIAlertController: Check if there's text in multiple UITextFields before button is pressed

Swift 5, Xcode 14.2 I've got two UIViewControllers that both have to display the same UIAlertController (only one is loaded at a time). Instead of using the same code twice, I added it to my existing ...
Neph's user avatar
  • 1,765
0 votes
1 answer
27 views

Flutter: How to display autocomplete suggestions beside TextField?

I'm trying to create a text field with a suggestion text, something like this: the @gmail.com it's a suggestion for the user to autocomplete the word, but I'm not able to put the text next to the ...
Fernando Delgadillo's user avatar
-1 votes
3 answers
45 views

Use Inputs from user as Min & Max values for UISlider

I have 2 x UITextFields for the user to put values in. I want to use those values as the min & max values for the UISlider. I have been struggling with this for 2 days already. This is my current ...
Neph's user avatar
  • 11
0 votes
0 answers
30 views

Cursor hovering over placeholder in UITextField

The cursor is hovering above the placeholder in this one UITextField, instead of in line with it like it should be (see image below for the problem). There is no change in code that affects this ...
lizardcoder's user avatar
0 votes
1 answer
37 views

Capturing user input data in a UITextField

I created 2 UITextFields for the user to enter data (Int) into. I then want to create a var from the user input data to use in some equations. How do I go about recording the data that the user ...
Neph's user avatar
  • 11
0 votes
1 answer
23 views

Flutter TextFormField validator message should the textfields position remain fixed or changed

When we validate a TextFormField should the validation error message push the TextFieldForm under the first one below it or not? What is the best practice? Should there be enough space between the ...
boodzadood's user avatar
1 vote
1 answer
28 views

Warning: validateDOMNesting(...): <fieldset> cannot appear as a descendant of <p>. at fieldset in TextField Component material ui react js

<div className="textInputTag"> <span className="label">{props.label}</span> <TextField placeholder={placeholder} error={error ? true : false} ...
Vidhun's user avatar
  • 11
0 votes
1 answer
25 views

How to create a custom UIPickerView to connect to UITextField in Swift

I was triyng to create a custom UIPickerView bacause I will need many different custom PickerViews to connect to my one UIViewController. I create the following code: let estadosArray = ["AC"...
fabiobh's user avatar
  • 653
0 votes
0 answers
32 views

Why is text entered in my UITextField just being recorded as nil?

I'm trying to take a simple integer entered in a UITextField and validate that against the "correct answer"—but I keep getting the error that the value is nil "Fatal error: Unexpectedly ...
Ian's user avatar
  • 1
0 votes
0 answers
46 views

How to make a textField as firstResponder in Swift iOS - UIKit

In a ViewController and have an UITextView and UITextField. I have selected a range of texts in a textView. So the textView has a cursor selection. I have to apply some attributes to the selectedRange ...
Harry's user avatar
  • 43
0 votes
0 answers
27 views

UITextField subclass used in view controller initialized from xib file : init(coder) never gets called

I have a simple view controller containing a custom UITextField subclass: final class MyVC: UIViewController { // MARK: View Properties @IBOutlet weak var textField: TextField! // ... ...
John DoeDoe's user avatar
1 vote
0 answers
35 views

Override resignFirstResponder: return value from super?

I have a custom view with a text field in it, I need to override resignFirstResponder() in my custom view to dismiss the keyboard for the embedded text field. When I read the doc it says: The default ...
Heuristic's user avatar
  • 5,031
0 votes
0 answers
115 views

Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan 428.667]

I am getting CALayer NAN crash. I have a scroll view, two textfields (let's say A and B) inside and inside of the scroll view below the two textfields, I have a tableView which is going to add ...
Shruti Suryawanshi's user avatar
0 votes
0 answers
45 views

Text field place holder text changing functionality?

I have a sign-up screen with a text field for entering an email where I want auto-correction disabled. When I leave the attributedPlaceholder text empty, auto-correction is disabled. However, as soon ...
ffb7c5's user avatar
  • 1
0 votes
1 answer
97 views

How to have UITextField allow only integers And Maximum 10 digit with Swift 5?

How to have UITextField allow only integers And Maximum 10 digit. Can Anyone Help Me. Hear Is My Code: func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, ...
Jenil Naliyadhara's user avatar
0 votes
1 answer
36 views

Text moves left in UITextField when using RightView

I am adding a button to a text field to clear it but when it's showing it shifts the text left, how can I keep it centre aligned. This happens regardless of my rightViewRect override, I'm just ...
Royal_Scribblz's user avatar
0 votes
0 answers
13 views

uikit PhoneNumberKit I can't enter data from keyboard

I have a phone field using uikit phonenumberkit. When we make phoneTextField.withExamplePlaceholder = false, we cannot enter anything in the field, I press it from the keyboard, but it is not written. ...
anildemirci's user avatar
0 votes
1 answer
22 views

UITextField on text change not counting letters properly when adding/deleting

I have the following code for my UITextField. func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { ...
letsCode's user avatar
  • 2,744
0 votes
1 answer
80 views

TextField binding to optional number

struct ContentView: View { @State private var data: Double? var body: some View { VStack { TextField("", value: $data, ...
quaternionboy's user avatar
0 votes
0 answers
16 views

Populate Second PickerView Data based on first PickerView Choice

I have created 3 Pickerviews in one Controller to choose country, language, and currency. The data are coming from Model through an API call that returns all the data using Alamofire and ObjectMapper ...
David Buik's user avatar
1 vote
2 answers
111 views

Can't animate textField font size change in a cell

I have a tableView cell, which consists of label and a textField. textField has a width constraint equal to 150 and its text set to systemBold 30 with Adjust to fit turned on and minimum size as 10 in ...
artexhibit's user avatar
0 votes
0 answers
32 views

Trouble sending data from TextField from within xib UIView popup back to ViewController

I'm having trouble getting data from user inputs within a popup UIView. I'm confused because the TextFieldDelegate function prints nil when attempting print(delegate) but succeeds with print(name), ...
impLo's user avatar
  • 1
0 votes
0 answers
56 views

SwiftUI change search navigationbar background color

How do I change the background color of the navigation bar search field? init() { let navBarAppearance = UINavigationBar.appearance() navBarAppearance.largeTitleTextAttributes = [....
Chip Dickinson's user avatar
0 votes
0 answers
10 views

Autocorrection proposals in textfields with name, lastName etc [duplicate]

I am looking for the way to give hints via autocorrection to a user while fulfilling textfields with name, lastname with their names from appleId account. I'd like that hints would be displayed on the ...
stanislaw.sobczyk's user avatar
0 votes
1 answer
43 views

Central Y align a textfield within a UIScrollView in Xcode

I have a UIScrollView which contains a UILabel with a UITextField directly beneath it. The scrollview is there to bump up the textField when the keyboard opens for editing I'm a bit confused to how I ...
Lena V's user avatar
  • 231
0 votes
0 answers
13 views

Edit the style of the upcoming text in a UITextField [duplicate]

I have a UITextView which has a UITextField inside. When I write in it, I want that if I click on a button the words I will write next will be for example bold. When I then click on the button again, ...
David's user avatar
  • 173
0 votes
2 answers
44 views

Edit UITextField in UIKit so that the text can be edited via buttons

I am currently developing a Notes app where I have a UITextField. When you select texts there is a popup where you can Format the text (see Screenshot). I want to have that functionality via buttons. ...
David's user avatar
  • 173
0 votes
0 answers
19 views

How do I limit my textfield input using button?

How do I limit my textfield input using button like (pin lock , Google pay pin) where you can add only 4 buttons maximum.
Yousuf N's user avatar
0 votes
1 answer
38 views

How to make editingDidEnd not trigger when user tap back navigation in swift?

Currently i have an issue in editingDidEnd method of swift textfield. I have a module inside editingDidEnd func to check some validation in B ViewController. If the validation is wrong then it shows ...
lauwis's user avatar
  • 189
0 votes
0 answers
36 views

Text fields in swift assigning to array

Trying to append Class Values(Class A,Class B,Class C) with its respective int values(100,200,300 etc). Class A,Class B, Class c are values that im fetching from pickerView. Picker view doesn´t have ...
NAVEEN B's user avatar
0 votes
0 answers
90 views

KeyboardLayoutGuide issue

I can't seem to get the constraints working so the keyboard does not cover the textfield so the user can see while typing. Can someone help? I'm coding in Xcode using UIKit. Here is my current code. ...
blue2023's user avatar
0 votes
0 answers
40 views

Swift password keyboard suggestions

How can I achieve such password suggestions as in the picture. Currently I only have a “Password” suggestion in the middle (opens modal with keychain saved credentials)? Already tried making the: ...
Tropicano's user avatar
  • 261
0 votes
1 answer
50 views

How do I create IBAction for a textfield made programmatically?

I've made a UITextField in my view controller. let label = UITextField(frame: CGRect(x: 0, y: 0, width: 300, height: 21)) I was wondering how I would make an IBAction for this. I'm making a variable ...
Abhi's user avatar
  • 5
0 votes
1 answer
36 views

Strange Behavior with React State and MUI TextFields

I have a basic set of code .. That I am trying to toggle: {(isLinkPhone) ? <Box> <TextField value={phone} label="Phone Number" ...
Zak's user avatar
  • 6,865
0 votes
1 answer
22 views

Get NSAttributedString from UITextField within NSRange

Let's assume I have this code: let string = "This is a <b>bold</b> text" let data = Data(string.utf8) let attributedText = try! NSAttributedString(data: data, options: [....
KANAYO AUGUSTIN UG's user avatar
0 votes
0 answers
51 views

Clear text field when typing within alert - Swift

I have an game app where players count cows on road trip. I have a button that comes up with an alert that allow players to enter however many cows they see. I had an error where if they pressed "...
BenG94's user avatar
  • 23
1 vote
0 answers
37 views

IOS App - SomeTime Uitextfield "PASTE" command appear in top left corner

After Orientation change in device The PASTE menu is displayed on top-left of the screen and cannot be accessed. Please see Screenshot. How to display "PASTE" command above to textField? ...
Shital Bhikhadiya's user avatar
0 votes
0 answers
28 views

Turn off text suggestions when I swipe on the keyboard

I know how to disable the text suggestions on an UITextField through the following properties: textField.spellCheckingType = .no textField.autocorrectionType = .no But when I swipe on the Keyboard ...
matzino's user avatar
  • 3,534
0 votes
0 answers
38 views

How to get notification from a custom UITextField

I have a Swiftui textfield button with the body like below, and a subclass of UITextField called MyTextField. What change should I make in order to successfully down cast obj.object to MyTextField var ...
oaranger's user avatar
  • 159
0 votes
1 answer
31 views

Enable button only after text fields are entered

Apple started rejecting my app (after yrs of approvals) - I have 2 text fields for a few char of last, first name, then press Go. They claim - I can't reproduce that the app crashes if you just press ...
user3741598's user avatar
0 votes
0 answers
30 views

UITextField setText: crashes occasionally

I don't know why it crash only sometimes in some users' phone, but in my phone I never met this... Here is someone else catch the log in his phone and send to me... I have try to test many time, but ...
Mr.Vexing's user avatar
0 votes
1 answer
56 views

How to trim several textfield in swift at once?

I have several textfield in a page. Currently i'm trimming every textfield one by one like code below. public struct CustomerAddressDetail: Encodable { public var fullname: String? public var ...
lauwis premium's user avatar
-1 votes
1 answer
47 views

Detect up/down arrow keys in UISearchBar so keyboard can be used to highlight search results

How can I detect presses of the up/down arrow keys on the keyboard when my UISearchBar is the first responder? I want users to be able to use the keyboard to select items in the list of search results....
bmueller's user avatar
  • 2,661
0 votes
0 answers
43 views

How to hide/show part of the text by button tap

I have long text in UILabel and button, which could hide/show this text. But I don't understand how to realize this. My text is located in a cell. Button in next cell. At the first time I need to show ...
Mikl.hart's user avatar
0 votes
0 answers
32 views

Tootlip inside TextField helperText when error is true

I have a TextField like that: <TextField label='שם סקופ' onChange={(e) => onChangeValue('scopeName', e.target.value)} error={error.scopeNameError !==...
Ofir Sasson's user avatar
1 vote
3 answers
881 views

change TextField label position

I'm trying to change the position of a label in TextFiled without configure my whole project to be rlt like I've seen here on other questions. I just want to change it in style and only for this ...
Ofir Sasson's user avatar
1 vote
1 answer
300 views

How to restrict the textfield to accept max 3 digits with a decimal value of two digits

I am using Xcode 14 Swift 5 and I am new to it. I am trying to make the textField accpet maximum 3 digits but also can have a decimal number in it with 2 digits. (E.g. the user can enter 123 or 123.45 ...
Hammam Aburaidi's user avatar

1
2 3 4 5
171