Ben
Ben

Reputation: 1031

Edit UItextview from UIButton

I have a UIbutton and I would like when I press it to edit the content of a UITextView with the Keyboard. I have been looking a lot on internet and finally found nothing of documentation about to programaticaly edit an UITextView.

It is possible to do this ?

Upvotes: 0

Views: 162

Answers (2)

BergP
BergP

Reputation: 3545

try use [textView becomeFirstResponder];

Upvotes: 1

James Paolantonio
James Paolantonio

Reputation: 2194

UITextView natively supports editing. Try this:

- (IBAction)clicked:(id)sender {
    textView.editable = YES;
    [textView becomeFirstResponder];
}

Optimally, you can make the textView always editable, or turn off editing after another button is pressed.

Upvotes: 3

Related Questions