Questions tagged [uitextfield]

1

votes
1

answer
2.1k

Views

touchesBegan not called when textfield is in uitableview's cell

so i have a textfield, i have the UITextFieldDelegate in .h file. i declare the textfield in .m file: UITextField * titletextfield i put the textfield in one of the cell of a table view. i set the textfield delegate to self, -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPa...
m_____ilk
1

votes
1

answer
1.1k

Views

inputAccessoryView Not calling when keyboard appearing

I have added InputAccessoryViewto my keyboard disappear. It woks fine. But in some ViewController its not appearing. Even that method doesnt call. I have a button. When I click on that my text field become first responder automatically. (cursor focus on the textField when click on that button) Key...
IRD
1

votes
2

answer
37

Views

Allow Backspace with character set

I am having trouble deleting in my text field. So I have a text field for a person name only allowing letters. But when I hit the delete or backspace it doesn't seem to work. This is what my code looks like. func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacemen...
Luis F Ramirez
0

votes
0

answer
13

Views

textfield in closure swift

let creatorDB = Database.database().reference().child("A") creatorDB.queryLimited(toLast: 1).observe(.childAdded) { (snapshot) in let B = snapshot.value as! String print(B) let messageDB = Database.database().reference().child("\(B))/Messages/") let messageDictionary = ["Sender": Auth.auth().current...
J.Doe
1

votes
3

answer
477

Views

Getting nothing from UITextField

In the below code I have a button which will prompt user to enter my admin passphrase. If I click Ok button it should be able to set message to inputTextField and display the message var inputTextField: UITextField? @IBAction func logOutButton(sender: AnyObject) { let actionController = UIAlertCont...
J.Doe
1

votes
6

answer
503

Views

resignFirstResponder with Text Field is not working

I have four UITextFields and associated each with an outlet in .h files. I have also defined 4 dismiss function for each textfield as shown below: - (IBAction)dismiss1:(id)sender; - (IBAction)dismiss2:(id)sender; - (IBAction)dismiss3:(id)sender; - (IBAction)dismiss4:(id)sender; @property (strong, n...
Wenjun Wu
1

votes
2

answer
61

Views

Swift: how to assign a string array to the text property of an array of UITextFields?

If I have 2 string arrays, it'd be fairly simply to assign one to the other in one line of code (w/o having to use a for-loop): var sArray1 = ["A","B","C"] var sArray2 = sArray1 However, I'd like to do something similar with an array of UITextFields, but can't figure it out. I feel like it should lo...
Kayan
-2

votes
0

answer
13

Views

What is the standard / most common UI effect for UITextField validation?

I’ve been looking at cocoapods to provideUITextField validation, I mean the UI effect, not the data. I’ve been looking around Apples apps for some clue as to how to provide such an effect, without luck. I’m trying to provide something subtle. I found this Show error icon automatically in UITe...
Jules
1

votes
1

answer
412

Views

Is there a bulit in method to enter text from right to left in an iOS 6 UITextField?

For instance, if I wanted to input 12345:        5      45     345   2345 12345 I can try and create my own method to do this, but I was wondering if there is a built in way to do this.
methodmain
1

votes
1

answer
374

Views

Putting in Parentheses While Typing? [duplicate]

Possible Duplicate: Localized phone number formatting I am trying to make it to where you type in a phone number and while typing, it realizes that there are so many characters and adds in parentheses: (xxx)xxx-xxxx. I have looked on Stack Overflow for any similar answers to my problem and I came a...
Zack
1

votes
3

answer
57

Views

Using a method in Objective-C cocoa

I'm having trouble with something very basic. I want to call this action: - (IBAction)changeGreeting:(id)sender { self.userName = self.textField.text; NSString *nameString = self.userName; if ([nameString length]==0) { nameString = @"World"; } NSString *greeting = [[NSString alloc] initWithFormat:@"...
chuckieDub
1

votes
3

answer
599

Views

Next button don't navigate through UITextField

After a some time, searching here for some solutions we found this post: How to navigate through textfields (Next / Done Buttons) We tried that but unfortunately it doesn't work at all. Note that we put the UITextFields inside a UITableView. We think the problem is around the Delegates but we don't...
Roger Fernandez Guri
1

votes
1

answer
1.3k

Views

How can I know uitextfield has be hit when it is first responder

I make a textfield to comment, comment can have emotion or any other content like tag. so I will change the textfield 's input view from keyboard to custom view, and I need when I touch the textfield again, the input view should be keyboard again. Now I cannot receive the event that touch textfield...
ZhouQi
1

votes
1

answer
104

Views

UITextField user interaction issue in Adhoc application iOs

I have created an iPhone app and created it's AdHoc installation file (.ipa) using XCode 4.5, iOs6. And I have installed the app on my device successfully via iTunes. The issue is, the app has one Login page and Sign Up page, which contains UITextFields. In the login page it created via IB but in si...
Mithuzz
1

votes
1

answer
87

Views

No text is pasted when text is longer than max length in iOS

I am trying to paste a longer text in a textfield, longer than the defined maximum length. However no text is pasted. Is this a default behavior in iOS? Thanks
MiuMiu
1

votes
2

answer
368

Views

How to clear the text within a UITextField using an IBAction?

I thought this would be pretty simple but apparently it isn't, at least not to me. I have a UITextField declared in my .h file and declared its property, as well as an IBAction to clear the text within the field. IBOutlet UITextField *textField1; @property(nonatomic, retain) UITextField *textField1;...
Taylor
1

votes
2

answer
358

Views

ios edit textfield infinite loop

Problem: I have a method that handles editingChanged events and another method that updates my textfields from an object model. The problem is that if I modify the text of the field that sent the event, it triggers editingChanged again and I enter an infinite loop (only in ios 5)! Example: - (IBAct...
jermel
1

votes
2

answer
250

Views

How do I check for a specific UITextField out of many?

Original question: I have 3 UITextFields (nameField, locationField, and discriptionField) I need to have a if statement trigger on discriptionField only, however the way I have tried it (configured below) all 3 textfields perform setViewMovedUp. I have also tried if([sender isEqual: discriptionFiel...
FireSky
1

votes
2

answer
89

Views

Push a string and display in a UITextField

I am doing a small app and I am using a UISplitVIewController and I am trying to push the UITable cell text to the detail view and display it in a UITextField. I have managed to push the string nicely when i test it with a NSLog but when i apply to the UITextField it does not display not sure why he...
Led
1

votes
3

answer
430

Views

Modify CoreData entity attribute value via UITextView

I have UITextView which shows some text data from CoreData entity. I need the possibility to edit this text data and save changes after keyboard dismissed. How to do that? I know how to save data but I don't know how to dismiss keyboard if I tap outside UITextView. May be there is some native way to...
Romowski
1

votes
2

answer
398

Views

Detect carriage return in UITextField

I have a app that enables the user to enter comments in a series of UITextViews. When complete the app generates a pdf report. Since the text entered varies in length the app needs to calculate where to position the text on the pdf. What I can't figure out is how to detect if a return has been inclu...
RGriffiths
1

votes
2

answer
1.6k

Views

Setting the title of current column in UITextField from UIPickerView?

I have a UIPickerView that is being automatically loaded in loaded when a user touches the UITextField, at the end of selection the user can close the UIPicker by touching the "close" that I have added in the inputAccessoryView = toolbar;. My problem is that I need to set the value that is chosen in...
vzm
1

votes
1

answer
491

Views

iOS - Curved Rounded UITextfield

I need to have a textfield in my app that is curved, I am able to pre-define the path. I have an textfield in my storyboard, and when a button is tapped, a text field needs to appear in, but curved. How Do I achieve the curved part, making the textfield round and the text curve as it is entered? tha...
Ari Porad
1

votes
2

answer
240

Views

Is there anyway to limit the number of character in UITextfield to 5?

Iam trying to limit the number of character in a textfield to 5 .So when we trying to enter the 6th character it will not do anything? is that possible .I saw below code but its not working .I have searched this in google got some results like - (BOOL)textField:(UITextField *)textField shouldChange...
Navi
1

votes
2

answer
155

Views

Need assistance regarding textField:shouldChangeCharactersInRange:replacementString:

UITextFieldDelegate Protocol Reference says "Asks the delegate if the specified text should be changed." regarding textField:shouldChangeCharactersInRange:replacementString: I have UITextField and only excepting numbers, I don't want 0 as the first number in UITextField, if user press 0 it must not...
S.J
1

votes
2

answer
1.8k

Views

resignFirstResponder does not hide the keyboard

I was trying to include a UITextField inside a UIAlertView with the following code: UIAlertView *newLabel = [[UIAlertView alloc]initWithTitle:@"New Label" message:@"\n" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; UITextField *newLabelNameField = [[UITextField alloc]initW...
Harikrishnan
1

votes
1

answer
104

Views

UITextField crashing after 7 keystrokes

I have a UITextField. When I type in it, it works fine, until I type in the 7th keystroke, at which point it crashes. The crash doesn't show up in XCode - there's no indication that it crashed at all. No crash log or anything of the sort. I'm running this on an iPad. EDIT: Disconnecting from XCode m...
Andrew
1

votes
2

answer
528

Views

How can I get a tag-based UITextField?

How can I bring this tagging effect in an iOS UITextField? I have a group of NSStrings and I would like to display them as given in the image.
Muruganandham K
1

votes
1

answer
540

Views

Determine how many characters there are after a certain character in UITextField

I am working with a UITextField and numerical input. I need to determine how many characters there are AFTER a specific character(.). Is this possible with NSString methods at all, if so How? I have tried using the shouldReplaceCharacters: method without much success. Thanks, Virindh Borra
virindh
1

votes
3

answer
273

Views

how to have UITextField push to a new ViewController when a string in an NSArray is used?

I have created a UITextField called textField, an NSArray of strings called keywordsArray, and a submit button. What I want to have happen is that if the user's text input to the UITextField contains one of the strings in the keywordsArray it would push to one view controller, if not it would push t...
rivtracks
1

votes
2

answer
2.4k

Views

iOS: How to add constraints for textfield in a table cell in code

I use Xcode5, iOS SDK 7. I create a UITextField in a table cell in code, not in storyboard. I want the width of textField should always be same as the width of the cell, but I don't know how achieve it. I know I should use NSLayoutConstraint, but I can't find a tutorial, and I have tried in my way,...
abentotoro
1

votes
3

answer
639

Views

Display modally custom keyboard view controller for editing a UITextField

By default when tapping on a UITextField iOS will display a default keyboard. Is it possible to bypass this? I would like to display modally a custom view controller on tap on the textField and be able to edit the textField through this controller. Is there a recommended way?
tiguero
1

votes
1

answer
69

Views

Creating a UITextField that creates a new line when needed

I was wondering how I could create a UITextField that would create a new line when the text reaches it's edge. Here how I am creating the text view: UITextField *textField = [[UITextField alloc] init]; textField.frame = CGRectMake(0, 194, 320, 568); textField.contentVerticalAlignment = UIControlCon...
matthew
1

votes
3

answer
200

Views

How to initialize a custom UITableViewCell from didSelectRowAtIndexPath

I would like to know how to get an instance of my custom UITableViewCell so that I can set a UITextfield as the first responder This is how I set the custom cell inside cellForRowAtIndexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { stat...
HurkNburkS
1

votes
3

answer
222

Views

Saving Text on UITextField after pressing Return or Done key

Good day! I just want to know if how can i make a default text for my UItextField? for example, i typed 12345 in my text field then after i press "return" or "Done" key on my keyboard it should stay there forever even i close the app, or power off my device.
user3202533
1

votes
2

answer
341

Views

Multiply data from a UItextfield?

I'm new to coding and i need help for something very simple. I want to create a Youtube View/Money calculator so i need to take the number of views and multiply it by 0.4 ish to get a rougly estimate of how much that video made according to the views. My main.storyboard looks like this: I have a UI...
17yrsDev
1

votes
2

answer
477

Views

How to disable button if no text in textfield? [closed]

I need help with an app I'm making in Xcode. I have a note submission part of my app. What code should I implement to disable the "save" button until text has been entered into the textfield? Thanks in advance:3
Christian Lowery
1

votes
2

answer
521

Views

Get input from a keyboard that is activated by a UILabel

I am able to activate a keyboard when users touch a label in either a UITableViewCell or UICollectionViewCell: UITextField *tf = [[UITextField alloc] initWithFrame:[cell bounds]]; [tf setKeyboardType:UIKeyboardTypeNumberPad]; [cell.lblTest addSubview:tf]; [cell.lblTest setUserInteractionEnabled:YES]...
Anthony Kong
1

votes
1

answer
1k

Views

Keyboard events called before UITextView delegate events

I have a UITableView with UITextViews and UITextFields on it's cells. As obvious the keyboard overlaps the lower cells and you cannot see what you are typing. So I want to scroll the tableview to get the field visible. I wrote the code the iOS docs recommended: https://developer.apple.com/library/io...
6rod9
1

votes
4

answer
860

Views

Is there a way to change the color of the text inside a textfield as you are typing?

I am looking to change the colour of the font if the text length of the textfield is less than 4. But I only want it to show up when I have finished typing (Gone off the text field). I have this if ([_username.text length] < 4){ _username.textColor = [UIColor redColor]; } else{ _username.textColor...
maxisme

View additional questions