Skip to content

a custom subclass of UIControl that triggers an action when user presses the button for required period of time.

Notifications You must be signed in to change notification settings

tankista/LongPressButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LongPressButton

Description

A custom UI control that allows user to trigger an event when long presses the controll. When user puts a finer on the control an internal timer is started and after minimumPressDuration is reached control begins new timer and starts animating the progress. Also a UIControlEvent.valueChanged event is sent. If user lifts the finger before requiredPressDuration is reached UIControlEvent.touchCancel control event is sent. If user holds finger longer than requiredPressDuration, progress animation is finished and UIControlEvent.primaryActionTriggered is called.

Preview Images

Features

  • animates long press duration
  • detects single touch up inside without showing progress animation
  • on scales down on touch down
  • set title text for control states and control events
  • set title text attributes for control states
  • set background colors for control states
  • supports UIAppearance

About

a custom subclass of UIControl that triggers an action when user presses the button for required period of time.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages