Giter Site home page Giter Site logo

drag-menu's Introduction

Drag-Menu

A drag-to-reveal menu that allow user to drag at somewhere and see a menu show up. The drag menu will stick at the point that user dragged, configurable if you want it's center to stick at a point.

As a League of Legends lover, I made an example to show that how i customize it and make it like the radial ping menu in League of Legends. Thinking to add ping sound and notification for user lol

In addition, I also wrote some code to show that how to restrict a pointer view within a radius. It may suitable for making a virtual D-Pad or something.

ScreenShot
ScreenShot ย  ScreenShot

Usage
Just simply include DragMenuView.h, add it into the TOP of your view. Then register a UIPanGestureRecognizer in a draggable view. Reminded that this will use your drag gesture so that it is not compatible with your scrollviews .

Example:

UIPanGestureRecognizer *panGR = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(dragEvent:)];
[panGR setMaximumNumberOfTouches:1];
[panGR setMinimumNumberOfTouches:1];
[self.view addGestureRecognizer:panGR];

Dont forget to implement the pan gesture callback and pass it to my drag menu

- (void) dragEvent:(UIPanGestureRecognizer *)panGR
{
[demoDMView dragEvent:panGR];
}

Contribute
I'd love to include your contributions. Feel free to improve it, send comments or suggestions. Please let me know if you have great idea on it.

Contact Me
You can add me on Facebook - http://www.facebook.com/seitkk

drag-menu's People

Contributors

seitk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.