Questions tagged [uitextfield]

1

votes
1

answer
147

Views

How to set pickerView and Keyboard for one textField

This is my first app. I have two text fields one for selecting Projects and second for selecting Tasks. If I select one project from the 1st text field and its showing related tasks in the 2nd text field. If task array is empty, then I have to show keyboard for entering some text for input to the 2n...
Appu Y
1

votes
1

answer
27

Views

Views alpha and frame property spoil when UITextFields first responder changes

I have a view (Lets called thirdStackView) and two textfield (Lets called them textfield b and c). In my viewdidload, I give their anchors and make textfields alpha to 0, also y frame of textfields to -100. With a button tap, I move thirdstachview out of screen with an animation and make textfields...
Emre Önder
1

votes
0

answer
33

Views

UITableViewController does not scroll correctly with a container view

I have a UITableViewController with 3 static cells. The second one is a container view. This container view is a UIViewController form with some UITextField's. When I touch any of UITextField's it does not scroll to the right position, above the keyboard and in the visible area. Every textfields go...
1

votes
2

answer
30

Views

How to leave only the lower border of UITextField?

It is necessary to leave only the bottom border at UITextField. For some reason my code does not work. let bottomLine = CALayer() bottomLine.frame = CGRect(x:0.0, y:1.0, width: myTextField.frame.width, height: myTextField.frame.height - 1) bottomLine.backgroundColor = UIColor.white.cgColor myTextFi...
Sergey Verigin
13

votes
10

answer
28.2k

Views

Formattting Phone number in Swift

I'm formatting my textfiled text once the user start typing the phone number into this format type 0 (555) 444 66 77 and it is working fine but once I get the number from the server I get it like this 05554446677 So please could you tell me how I can edit it in the same format once I get it fro the...
CAN
1

votes
2

answer
68

Views

UITEXTFIELD input data to alert box ok clicked

I am implementing a user form and getting details from user, after filling all the fields when the user press the SUBMIT button alert box is created (The alert box is kind of Terms and condition) when the user Agree to it. It must take all the UITextField input data. I have created a class and in th...
1

votes
1

answer
57

Views

Capture iOS 3D Touch cursor

In iOS when you 3D Touch on the iPhone keyboard it allows for moving the cursor around the text field. I would like to build a text field from scratch and have similar feature. Is it possible to capture this event?
Tobol
1

votes
2

answer
83

Views

Textfield inside a scroll view only moves up after keyboard appears IOS

I have the following problem: I have a scrollView that has a textField inside it. I need that when i tap on the textField the keyboard shows up and textField (inside the scroll) moves up immediately (at the same time) keyboard shows. Right now textField appears but with a delay, like a few milliseco...
leticia r
1

votes
1

answer
32

Views

How to perform an action on a ViewController when pushing a notification and retrieve its data

I would like to know how to change the value of a UITextField on a ViewController whenever a notification arrives and the user taps on it. The notification contains the String that I will be putting on that UITextField. This is how my app looks I can currently retrieve the notification data on AppDe...
Carmen Gordillo
1

votes
3

answer
129

Views

Only allow button click if username and password text fields are filled in - IOS (Login page)

How do I go about allowing my login button to be clicked only if the username and password text fields have been filled in? Ideally the login button would be grayed out and un-clickable, only becoming fully functional once all fields have been filled in. I'm very new to iOS development, so I am also...
1

votes
1

answer
24

Views

Swift 4 - UITextField DidBeginEditing

I have four textfields (PISARadius, aliasingVelocity, AIVMax, and AIVTI) and two UIButtons (calcEROAButton and regurgVolumeButton). I'm trying to enable the calcEROAButton only when PISARadius, aliasingVelocity, and AIVMax have numerical input and regurgVolumeButton when ALL four text fields have in...
Rishi Kumar
1

votes
1

answer
74

Views

UITextField and UIDatePicker reusable code

Hi found this code here on reddit which change the keyboard of a textfield into UIDatepicker so we can select date. The code works great. However, I'm trying to refactor this make it reusable since I have 3 textfields on the same VC that all need to be able to select the date. Here is the code class...
MightAsWell
1

votes
1

answer
67

Views

How to Pass Data From Pop-Over Subview to View Controller with Swift 4

I'm trying to pass the text data from my UITextField (taskNameField) subview that's apart of my taskCreator subview. Not sure how to get my hands on this data outside of the subview so that I can add it to my task array. Any help would be greatly appreciated. import UIKit var userTasks: [Task] = []...
Carter Foughty
1

votes
0

answer
131

Views

Form for OTP entry with six single-character text fields

I am working on an app in which I have to pass 6 digits OTP through 6 textFields in which you to provide only one character and after that it automatically goes to another textField. I created 6 textFields outlets and used this code. The problem I have is that I want to change the specific textField...
wings
1

votes
1

answer
110

Views

How can a UIButton listen to changes to other Buttons, a change to a UILabel's text, and a change to a UITextView all at the same time

My vc contains: -1 name textView -1 label // for flavors -2 radio buttons // yes and no -1 nextButton What I want to do is keep the nextButton disabled until the textView is filled out, the label's text value is changed from its initial title of 'Pick a Flavor' to whatever flavor they pick, and 1 of...
Lance Samaria
1

votes
1

answer
65

Views

Remove a sublayer from TextField

I need two functions, One to add a bottom boarder and one to remove a bottom boarder. How can I remove this boarder I have created? extension UITextField { func addBottomBorder(){ let bottomLine = CALayer() bottomLine.frame = CGRect.init(x: 0, y: self.frame.size.height - 1, width: self.frame.size.wi...
Oliver Ferris
1

votes
1

answer
44

Views

How to Change uitextfield leftView image tintColor on editing

I'm trying to achieve UITextField editing or not editing style like this: But the trickiest part for me is How to change that left image tint color. I have achieved this so far: My code: UITextField lazy var email: UITextField = { let name = UITextField() name.layer.cornerRadius = 17.5 name.layer.bo...
Faisal Shahzad
1

votes
1

answer
93

Views

UITextField not working with add constraints programmatically

Here is my code , I am adding UITextfield programtically in scrollview. But UITextField is unable to open keyboard. It looks like UITextField is not enabling even added user interaction enabled true. I only use the constraints, no storyboard, no xibs. Only through Constraints Programmatically. Bel...
Humza Shahid
1

votes
0

answer
53

Views

Textfield movable programmatically swift 4

I need your help.. I need to be able to move a UITextField with the UITapGestureRecognizer. The textField is inserted in a view, how can I touch it and move it in the View? And how can I connect my textfield to the color and font buttons, so when I click on one of them I change the color or font to...
1

votes
0

answer
70

Views

My app doesn't do the code I've been write Swift

I'm trying to understand why my code is not totally played by my application? In fact I have a button on a viewController when the user press the button two textfield is normal become interactive and the background will change to show the possibility of interaction. When I've do the code and make t...
flyer74
1

votes
1

answer
171

Views

iOS - Best Approach to Design Custom UITextField with Transparent Background

I have to create a textfield given in above image. This text field will be used in the entire app within UITableViewCell and UIView. What could be the best approach for this?. So far I think UIBezierPath is the last option.
Hitesh Agarwal
1

votes
0

answer
80

Views

iOS 12 - oneTimeCode OTP delegate

Is there any delegate getting fired when the user taps the OTP suggestion that iOS provides? I know that I could use UITextFieldDelegate methods to detect changes in the textfield's text property, but knowing that the user has pressed the button would make things so much easier...
jdev
1

votes
2

answer
46

Views

leaving textfields blank - crash - swift 4

I am trying to create a course avg calculator with textfields. However if I only want to enter in a few marks (i.e. not filling out all the textfields) I get a crash. I get this error: Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value In my code, I tried to avoid t...
MontgommeryJR
1

votes
1

answer
34

Views

Text field four-sided border with animation

I would like to highlight text field four-side border when user clicked inside and reverting back when user's editing end. To achieve this I have following code snippet inside editingDidBegin function of my text field. func pulseBorderColor() { let pulseAnimation = CABasicAnimation(keyPath: 'borderC...
Atalay Asa
1

votes
1

answer
47

Views

Should I enable autocorrect on a name text field for a sign up view in iOS?

Would that annoy users, or does autocorrect work well with entering names in? I've seen on other apps that there is autocorrect enabled on their name text fields, but I don't know if that is such a good idea.
Ken Mueller
1

votes
1

answer
45

Views

Is is possible in iOS to have an ascii capable decimal pad as the keyboard type for a UITextfield's keyboard type?

The app I'm writing supports multiple languages but there is 1 textfield where I want the user to write only ascii numbers (i.e. no arabic numbers) and decimal separators. I know it's possible to set a UITextfield's keyboardType but unfortunately there is a .decimalPad and asciiCapableNumberPad but...
lunaticpanda101
1

votes
1

answer
52

Views

How to fix my custom UITextField object in Swift 3?

I have issues when I'm trying to create a custom object (UITextField) in Swift 3, it didn't happen before.
Nuccle
1

votes
1

answer
36

Views

how to Use a textfield as a “search bar” for a table view

I have a table view embedded into a regular view (as shown in this picture: Picture) I have a search bar and working code so that when you start searching for a person's email, the table view automatically updates and just displays the people that match the search criteria. Is there any way of usin...
1

votes
0

answer
26

Views

UITextfield value increases incremental when 6,7,8,9 are pressed and limits editing

A UITextField is responding incorrectly. I am not able to delete the present value, but the value will change when I press the numbers 6,7,8,9 on the keyboard. Methods for this textfield are set using UITextfield delegate. It works when I block out the section of code under shouldChangeCharactersIn....
k.thomas
1

votes
1

answer
39

Views

Making a new UITableView cell's textField the firstResponder

I currently have a table view with cells that contain a label and a textfield, I also have a + bar button item that adds new cells. What I hope to accomplish is when the user presses the + button the new cell is created and the text field of this cell would automatically become first responder. Bel...
David
1

votes
1

answer
13

Views

Become first responder next available (not hidden) text field

I'm trying to make than a Swift 4 iPhone app that has various user input text fields go to the other text field when the user presses the Enter key. I did it with a switch statement, but now that I added the capacity of the text fields to hide or unhide according to a previous selection of the user,...
Rodrigo Reyes
1

votes
1

answer
28

Views

Auto shift keyboard curser for OTP in objective C

I am trying to implement an OTP system in iOS. After getiing OTP (One Time Password) I am trying to change the cursor of keyboard but the cursor is shifting after typing in keyboard twice. For the first textfield it is working fine but while trying to add in the second textfield it is not working un...
1

votes
1

answer
30

Views

iOS 12: UITextField not deallocating

UITextField which is pre-filled with some text and with keyboard active is not deallocating when close controller. Here is an example: class TextFieldViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = UIColor.lightGray let textField = TestText...
vitalytimofeev
1

votes
1

answer
52

Views

iOS keyboard hides a UITextField

When I press on a UITextField that is on the lower part of the screen, it is hidden by the keyboard. What I wanted to do is moving up the view, with the standard iOS animation, reaching the UITextField that in which I am inserting some text. I am developing the app in Swift 5 (Xcode 10.2) The result...
vFeder6
1

votes
2

answer
1.1k

Views

Intertesting problem with UITableViewCell and UITableView, Any solution?

I have a class inherited from UITableViewController and this is also the root class. This tableView contains three custom UITableViewCells (loaded from NIB file and not subclassed) and each UITableViewCell has one UITextField. Now when I implement delegate method - (BOOL)textField:(UITextField *)tex...
iamMobile
1

votes
1

answer
1.4k

Views

Make the keyboard appear for my custom UIView

I have a UIView subclass and I want the keyboard to appear when it is the first responder (so a backspace can be detected to 'delete' the view). I have tried making my UIView subclass adopt the UITextInputTraits protocol but it seems that's not enough to make the keyboard appear. How can this be don...
Michael Waterfall
1

votes
1

answer
691

Views

UITextField ellipses

I have a UITextField but when it overflows I want it to scroll not use an ellipses. Can you do this on the iPhone?
bobobobo
1

votes
1

answer
420

Views

why does the uitextfield never return nil when it becomes first responder?

when i make my textfield become first responder, the text field never returns nil, even if i force it to be nil by myTextField.text = nil; as soon as i comment out the '[myTextField becomeFirstResponder];' the text field is able to return nil. anybody have any idea why?
nathanjosiah
1

votes
4

answer
6.2k

Views

iPhone textfields/keyboard - how to disable second textfield until first one has been completed

I have a login screen with two textfields (username and password). When the user clicks on either textfield, the keyboard appears and everything is fine. However, if the user clicks on the other textfield before clicking Done (on the keyboard) for the first textfield, the text for the username isn't...
user218485
1

votes
1

answer
1.6k

Views

how to get a UITextView to Clear like a UITextField does

im trying to get a UITextView to Clear like a UITextField does cant seem to get this I making a app that need to clear after tapping send much like a email or tweet with several lines of text. any code would be great thanks so very much
clad Davidson

View additional questions