576 questions
0
votes
1
answer
64
views
UITextField selects all text on focus when the content is long — how to keep the caret at the end?
I’m building a custom input field using UITextField. When the user taps to focus the field and the text is long, the entire text becomes selected by default. This is the same behavior you can see in ...
1
vote
0
answers
69
views
iOS Keyboard not hiding on another view tap
I have a stack view with UITextField (textView) and UIView (dropdown) in it.
Its a backend-driven UI, therefore the views are not initialized on screen load. Rather theyre added after UI request is ...
0
votes
1
answer
397
views
iOS - Control Input to UITextField from SwiftUI Buttons
I have a custom keypad that works with a custom text field. It looks great on the iPhone but not so great on the iPad. I want to control the text field with the buttons of the keypad but not have the ...
1
vote
2
answers
54
views
How to enable addButton when corresponding textField has 3+ characters typed in?
I have a textField and a submit button. The submit button is disabled by default and should only be enabled if textField has 3+ characters typed into it.
My code:
class AddNameVC: ...
0
votes
1
answer
225
views
How do I get the value of UITextField text instance property and update UITableView row whenever the user edits the UITextField text property?
How would I update a table view row as as a text field text changes? It is difficult to create a string from the arguments in textField(:shouldChangeCharactersIn:replacementString:) so that the string ...
1
vote
1
answer
584
views
How to detect otp type empty textfield swift ios
I'v ten textfields like otp for mobile number.I've handled all cases except like if user write digit in first textfield and focus goes to second textfield.Second textfield is empty and when i press ...
-1
votes
1
answer
1k
views
Keyboard dismisses on every character typed in text input in Swift
I have one textField.
private var verseTitle: UITextField = {
let tf = UITextField()
tf.placeholder = "TITLE"
tf.font = UIFont(suite16: .tBlackItalic, size: 18)
tf.textColor =...
0
votes
2
answers
292
views
How to star part of text field? Like 1234 **** **** 1234
While the user is entering the credit card number, I want to star a certain part of the text field as above for security. How can I do it?
4
votes
0
answers
541
views
How to change UITextField RightView size?
I trying put to 2 items in rightView component. for example;`
let label = UILabel(frame: CGRect(x: -80, y: 0, width: 100, height: 50))
let rightView = UIView(frame: CGRect(x: 100, y: 100, width: ...
0
votes
1
answer
322
views
How to add target to UITextField in a class other than ViewController
I am trying to write a class that has a method which observe text changes on UITextField objects.
When in ViewController, code below works as intended:
class ViewController: UIViewController {
@...
-1
votes
1
answer
139
views
How to get data from textFieldDidEndEditing to save to Firebase?
I am trying to get the inputted text from recipeName, servingsNumber, prepTime and cookTime to save to fb.
I know this is close to where I need to be. I am need some help with my save function. I need ...
0
votes
2
answers
921
views
How to disable the copy paste functionality in SkyFloatingLabelTextField in swift?
I am using the SkyFloatingLabelTextField class for UITextfield,How can I disable the Copy and paste functionality on this textfiled.
0
votes
2
answers
1k
views
UITextfield delegate method not getting called when text set programatically
My UIViewController confirms to UITextFieldDelegate and implements delegate method:
func textFieldDidEndEditing(_ textField: UITextField)
It also sets delegate = self in viewDidLoad
All works fine ...
2
votes
2
answers
5k
views
SwiftUI Dismiss Keyboard from UITextField
So for my own reasons, I need the full control that UITextField and its delegates would normally offer, but the screen it's being added to is written with SwiftUI. Needs a .decimal keyboard, so no ...
3
votes
2
answers
1k
views
textFieldDidEndEditing is not called in swift
I have a textfield in my tableview cell. When I am entering something and click on the submit button, I want to save the text in a struct to use it in other view controller. But the problem is , when ...
0
votes
1
answer
117
views
How to scroll to the bottom of a CollectionView when the user taps the InputAccessoryView
I have a comment section in my app where a user can 1) see all of the comments that have been posted and 2) post a comment of his own in the same view controller. When the user arrives at the view ...
1
vote
1
answer
932
views
Swift - app crash when presenting popover as already presented
I have a textfield which, as user types in it, triggers a popover to be presented with a list of suggested values which the user can select from. Here is the textfield:
lazy var iata: CustomTextField =...
0
votes
1
answer
74
views
Working with a dequeued, dequeueReusableCell - textField of cell when after being dequeued
I'm working with a VC that has as a variable amount of cells. Each cell contains an ingredient, as well as a percentage for the amount. I added an inputAccessoryView to the textField keyboard that has ...
0
votes
2
answers
56
views
UITextField Delegate method doesn't get triggered
I am trying to limit the number of characters that the user can enter to 1.
class ActivationViewController: UIViewController , UITextFieldDelegate{
@IBOutlet weak var activationCodeTextField1: ...
0
votes
1
answer
68
views
New view controller vs. hiding textfields with .isHidden = true
Disclaimer: I'm new to coding.
I'm making a personal finance app. When the user creates a new transaction, I want them to be presented with a single textfield at a time.
In a single view controller, I'...
0
votes
1
answer
1k
views
How to handle Tab key press in iOS?
I have a UIViewController which has 3 three UITextFields - TF1, TF2 and TF3. When the app is running on iOS simulator and I press Tab key, the focus moves to the next text field as expected.
TF3 is ...
0
votes
1
answer
1k
views
textField Maximum length and Postal Code validation
I have a textField to input a Canadian postal code. And I am using the following code to ensure the formatting is correct or else show an alert saying the formatting is incorrect. This is working with ...
0
votes
1
answer
895
views
how to detect caps lock key tap in iOS keyboard for UITextField?
How to detect if the user tapped on the caps lock button in iOS keyboard?
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> ...
0
votes
1
answer
31
views
Button disapper when write in textField ! Any help for this error?
I have a textField and button which binding with Keyboard, but when try to write in textField the button disapper and when closing the keyboard the button
I use this function
func bindToKeyboard()...
0
votes
1
answer
164
views
UIToolbar doesn't show again in view when dismissing keyboard in Swift
I have an UIToolbar containing a UITextField. I want to show the toolbar above the keyboard and then display it again when I finish editing inside the textfield.
The issue is that it is working when ...