Skip to content

balazsnemeth/NBTouchAndHoldButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#NBTouchAndHoldButton

This button is a subclass of UIButton, and you can use it very simply. You can put a UIButton using Interface Builder and change the class to NBTouchAndHoldButton in Identity Inspector. After it, you must configure the action programmatically which will be executed during the user is holding the button in touched state.

TouchAndHoldButton * pageDownButton = [TouchAndHoldButton buttonWithType:UIButtonTypeCustom];
[pageDownButton setTitle:@"Page Down" forState:UIControlStateNormal];
[pageDownButton addTarget:self action:@selector(pageDownAction:) forTouchAndHoldControlEventWithTimeInterval:0.2];

In this example, the button will fire calling the pageDownAction: in 200 ms intervals during the user touching and holding it.

About

UIButton subclass to implement a touch and hold state

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published