How to prevent keyboard hiding when pressing and holding the UITextview? - ios

I am developing chat application, in the chatViewController i have a tableView and textfield at bottom of the view . Messages are showing using uiTextView.
Scenario -
while messaging, the keyboard is on, i want to copy the last message text so while pressing and holding the textview keyboard got dismissed.
I don't want to hide the keyboard while copying the text.
If anyone know the solution please help me.
Thanks In Advance.

I think you are using the long press recognizer for copying text... so in long press recognizer method just add this line:
[textView becomeFirstResponder];

Related

How can I add textfield on keyboard in swift?

In my Purpose, I want to custom keyboard by adding textfield on the keyboard look like Facebook app on iOS. when you tap on comment button it will appear the keyboard on also have textfield above that.
Do you have any keyword or solution on that problem?. I am youngest with swift and write in native language. If you do not clear with my question please comment.
Thank in advance
I'm not sure if I understood your question, but it seems like you want a textfield just above the keyboard. For that you can add a TextField on the bottom of a view and make it move accordingly whenever the keyboard appears. Check this out: Move textfield when keyboard appears swift

UIModelPrestationFormSheet keyboard hides the textfield

UIModelPrestationFormSheet in that i've 2textfields in that i want to type somthing in the 2nd textfield but textfield hides behinds the keyboard-->http://i.stack.imgur.com/Chdv3.png
while i tap the 2nd textfield the keyboard gets hided>>>http://i.stack.imgur.com/0RR0v.png
check this tutorial from Apple documentations
https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html
Look for
Moving Content That Is Located Under the Keyboard

Click a button to show the keyboard iOS

I want to realize the function: when I click a button, a interface of keyboard will come out in a dependent interface. How can I do it? Just for iOS.
You need to add to your current view UITextField with frame = CGRectZero, create a reference to that textField in code and then on pressing button call becomeFirstResponder on textField.
You need to add an UITextField to your view and call then [myTextfield becomeFirstResponder]; Its possible to set the hidden attrribute from UITextField to YES - so the user will never see the textfield. After Keyboard input is finished you can remove the UITextField with removeFromSuperview.
Maybe a little bit dirty,but thats the solution I used often. I wonder if the SDK provide another possibility.

resignfirstresponder on a UITextView inside a UITableViewCell

I am hoping if someone can help me resolve an IOS/XCode question.
I need to have a UITextView created inside a UITableViewCell, this UITextView has responds to a user click, upon which a UIPopoverController will be displayed so that a sub-UITableView is displayed (inside the UIPopoverController) allowing a user to select from a list of choices (lines of text). After the user select the choice (one of the line of text), that line of text will then be displayed inside the said UITextView. First problem I am having is that when the user click on the UITextView the keyboard gets displayed instead of the UIPopoverController. How do I go about disabling ie. calling resignFirstResponder so that instead of the keyboard displaying, I get the UIPopoverController coming up instead. Would someone be kind enough to share similar codes? or point me to some sample of how this can be done? Thanks so much in advance.
You can use following delegate method to detect when textView is tapped and show your popOverController accordingly, return 'NO' in the delegate method so that no keyboard will appear...
- (BOOL)textViewShouldBeginEditing:(UITextView *)textView
{
// code to show popOverController
return NO;
}

Programmatically show the keyboard on iPhone app

I have a view with only one UITextView that is used to enter a value. I want that when the view shows, the textview becomes the first responder (that's the easy part) and also the default keyboard shows up. I tried searching for this in speca but to no avail. There are many posts on how to dismiss the keyboard, but what I want is to show the keyboard w/o waiting for user to touch my textview.
Just setting the text field to firstResponder should do the trick.
Inside your -viewDidLoad:
[myTextField becomeFirstResponder];

Resources