Skip to content

CayuseConcepts/KnobRotation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

A common user interface is a circular knob. Unfortunately, the stock API only provides the UIRotationGestureRecognizer as a means to turn the knob which would require the user to place two fingers on the screen and then perform a rotation gesture. This standard gesture is not very intuitive, and would be very awkward for this purpose. A much better gesture would be to simply allow the user to use one finger to rotate the knob. This demo details the code to create just such a custom gesture recognizer and names it SwirlGestureRecognizer.

For the demo, a simple colorful knob is allowed to rotate 360° with a default starting point of 0° straight up. The graphic is 320 pixels square, or 640 pixels for the retina @2x display. Having a symmetrical graphic makes rotation easy, but of course in practice it could be anything of any size, with any starting point and limits.

About

A Custom Gesture Recognizer Demo for iOS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published