I am currently building a custom keyboard and I am almost done. One problem that I have is with the delete button. When the user taps the delete button, it does what it should do and deletes the previous text entry. However when the user holds the button down, nothing happens. How do I make it so that when the user holds down the delete button, the keyboard continuously deletes like in the standard ios keyboard?
Asked
Active
Viewed 1,157 times
1
-
once have a look at this http://stackoverflow.com/questions/6179347/uibutton-long-press-event – Ravi Oct 07 '14 at 11:26
-
@anil Do you got any solution? I am facing same issue. – The iCoder Jan 29 '15 at 08:16
-
we have just clear the all text on long press @PavanMore – anil Jan 29 '15 at 09:00
-
@anil How ? I just tried making long press and deleting all text on long press, Its working for me: /** while ([self.textDocumentProxy hasText]) { [self.textDocumentProxy deleteBackward]; } **/ Is their any other way to clear ? – The iCoder Jan 29 '15 at 10:04
-
exactly i have delete it on long press as u said no any other solution of it – anil Jan 29 '15 at 10:42
-
https://itunes.apple.com/us/app/customkey-keyboard/id929596834 this my app link u can check it – anil Jan 29 '15 at 10:43
-
Possible duplicate of [ios 8 custom keyboard hold button to delete?](http://stackoverflow.com/questions/25633189/ios-8-custom-keyboard-hold-button-to-delete) – Khadija Daruwala Aug 31 '16 at 10:44
1 Answers
0
You should also register for the action UIControlEventTouchDownRepeat
for delete button by below way.
[deleteButton addTarget:self action:@selector(deleteCharacter:) forControlEvents:UIControlEventTouchDownRepeat];

Apurv
- 17,116
- 8
- 51
- 67