How to disable isEnable and isUserInteraction attributes but keep cursor show in UITextField? - ios

I have a custom framework for UITextField. For now, I want to disable two attribute as the question above but still keep the cursor show in my custom textfield. I already disable the keyboard with set the inputView = UIView(), and that successful for hide the keyboard even show the cursor inside textField.
My goal is disable both attributes like above or another for can not Select All action from my textField, but still keep the cursor available anytime.
Hope to hear the ideas from you guys. Thank a lot!

Related

How to move placeholder up while typing in the textfield? is it possible just from storyboard? or code in IOS Objective-C?

I have set the values of placeholder
self.baseURLTextField.placeholder = ServiceUrl_English;
self.paymentBaseURLTextField.placeholder = PAYMENTSERVICEURL_ENGLISH;
I just want to move the placeholder up while editing or typing in textfield. is it possible through just only storyboard? or code in Objective-C.
Not really the way you intended it. Placeholder is just a hint of what should be typed in the textField and it's supposed to be removed once text entry starts.
If you want the placeholder to "move up" I suggest you either prefill the textField with the text you want to preserve, or simply add the text at the point user starts typing in, and move the cursor to where you want the user text to start.
You can achieve this by putting a UILabel at the top of the text view then show/hide it whenever the user starts typing.
Or you can use a pod like JVFloatLabeledTextField

Hide TextField selection handles

Im my application when the user selects a TextField the existing text gets automatically selected when the Focus changes to the textfield. How do I hide the blue selection handles that appear?
The reason I want to automatically select the existing text is so that the user can begin typing and the textfield will automatically overwrite the existing value instead of appending to it.
I figured it out. You can set the enableInteractiveSelection property to false.

iOS -Objective C- Prevent the keyboard automatically hide when I set enable = NO on UITextField

I'm working on an App with Objective-C but I have a problem with my form.
I have several inputs view (UITextField) on it, and one with a particularly behavior.
When I select the checkbox, I prevent the user typing on the view and looks the view as disable( grayed out and without the blue bar flashing blue bar ) and keep the keyboard open.
When I set the UITextField as disable, the keyboard is automatically hidden.
Someone knows how to keep the keyboard open?
I need to something like the image attached, but without the blue bar flashing blue bar.
I did the logic to prevent the the user enter data on the input , but the keyboard is automatically hidden.
If the text field is disabled, the user cannot type into it and the dismissal of the keyboard is correct. You should not try to fight against that. (It sounds like you're trying to disable the keyboard for the wrong reasons anyway.)
In this case, it sounds like your timing is just off. When the user clicks the checkbox, your code responds. What you are doing there is just wrong. You should respond by moving the first responder to the next enabled text field yourself, and then disabling the first text field. That way, you are not disabling the text field while it is first responder; that's your whole mistake right there.

How to select a UITextField without showing UIKeyboard

I am wondering if there is a way to use a UITextField programatically (i.e. use buttons as inputs) so that you can select a UITextField but not show the UIKeyboard, then when you select a UIButton it would assign a string value to the currently selected UITextField.
I don't really know where to start.
I think you can visually change the appearance of the text field (for example add a blue border), let the user feel it’s “selected”. Then you just modify textfield.text when user presses button.
Or alternately, you can create a customized keyboard. There are many similar questions.
It seems that you don't really need a text field (e.g., edit/select text, etc.), but a "button that stays highlighted" instead. Then, you can programmatically change the button's title label to the specified string when the user taps the 'proper' buttons.

How do I set a UITextField as the default input field at app launch

I am writing an iPhone app with a keypad and two TextFields on a single view. The user types into each of the text fields. Because I want to use an on-screen keypad, I disabled the the keyboard from launching when each TextField is selected. (I used the method suggested in this thread:
Disable UITextField keyboard?
So far so good EXCEPT the cursor doesn't blink in the either of the two TextFields until they are selected. If I just begin typing without selecting, the first textfield is filled. That's OK, but I would like to set the cursor flashing in that field so the user is notified that that is where the input will go unless they select the other field.
I did not create the text fields programatically. I created them with Interface builder.
How do I programatically select the desired starting text field (ideally some highlight would show up when selected). Right now I just got lucky and the field I want to be the default is the default.
How do I place the flashing cursor onto the right side of that text field.
...Dale
Call [myTextField becomeFirstResponder]; this will notify the receiver that it is about to become first responder in its window. That should set the Cursor in the UITextField.
To programmatically activate a field and make it your starting text field you should use UIResponder's becomeFirstResponder method, which all UITextFields inherit from.
[textField becomeFirstResponder];

Resources