Questions tagged [uitextfielddelegate]
The methods declared by the UITextFieldDelegate protocol allow the adopting delegate to respond to messages from the UITextField class.
567
questions
2
votes
1
answer
38
views
Respond to specific key press in UITextField (UIViewRepresentable)
I would like to respond to keyboard presses in a UITextField wrapped as UIViewRepresentable. This is the code for the wrapper view:
import SwiftUI
import UIKit
struct ContentView: View {
@State ...
1
vote
1
answer
37
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 ...
0
votes
0
answers
25
views
How to select a UITextField with IBAction to make it FirstResponder?
I have implemented multiple TextFields in a static TableViewController like this:
import UIKit
class GameViewController: UITableViewController, UITextFieldDelegate {
@IBOutlet weak var ...
-1
votes
1
answer
123
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 =...
2
votes
1
answer
121
views
iOS keyboard: How can I start with a disabled done/return/go button on the keyboard and KEEP it disabled until the validation requirements are met?
I've got a text field delegate setup which disables/enables the done button on keyboard when certain conditions are met (between 5 and 15 characters, not just whitespace, etc...) using the "...
0
votes
2
answers
58
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?
1
vote
2
answers
95
views
custom percentage field UiTextField
i have a text field delegate method my use cases are :-
if (.) dot is not there limit input to two characters because 100% should not be discount.
if user input is 1.99 how can update the delegate ...
1
vote
0
answers
145
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: ...
1
vote
1
answer
53
views
How to listen for escape key in UITextField on MacCatalystApp?
I'm working on a MacCatalyst app. I want to listen for escape key when user is editing a UITextField.
I can listen to return key by accepting UITextFieldDelegate with method
func ...
0
votes
1
answer
92
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 {
@...
0
votes
2
answers
276
views
How to simultaneously change textField.text in a prototype cell?
I have a UITableViewController and a Prototype cell with a UITextField. When I change a textField.text in one of the cells I want it to be changed in all other cells which my tableView now have (for ...
-1
votes
1
answer
79
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
0
answers
48
views
Swift: array is set but is then empty when accessed
I have an array which is set once a specific API is called. However when I then try to access this array at a later point it is empty again.
The class in question looks like this:
class ...
0
votes
2
answers
132
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
1
answer
205
views
How to trigger textField(_:shouldChangeCharactersIn:replacementString:) method in iOS
I'm trying to make some features on UITextField which for input amount
Wrapper view contains this UITextField, and that view conforms UITextFieldDelegate
so i implement textField(_:...