Giter Club home page Giter Club logo

knobrotation's Introduction

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.

knobrotation's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

knobrotation's Issues

UIButtons on view

Very nice code, thank you!

I have some buttons on UIView. If you place a finger on UIButton and dragging, the rotation has some problems. Also the touchUpInside gesture of the button doesn't work. Is it any way to have functional UIButtons on the view with correct rotation?

Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.