ZhouQi
ZhouQi

Reputation: 531

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 again.

Thank you!

edit 1:

I have a ugly but useful way now.I add another textfield that hide back, when show emotion the second textfield become first responder. then touch the first textfield will show keyboard as usually .

I think it's not so good, if you have any better way please tell me. Thanks

Upvotes: 1

Views: 1382

Answers (1)

batman
batman

Reputation: 2476

This is because your textfield when touched the first time has become the first responder which you can detect in the following delegate. If you touch it again, you wont receive the event because the textfield hasnt resigned the responder yet. What you may try is to detect touches over the frame of the textfield after it has begun editing and then show the keyboard.

Upvotes: 3

Related Questions