Code Monkey home page Code Monkey logo

shape_and_gestures_ios_app's Introduction

Shape_and_Gestures_iOS_App


In this very simple app, I have tried to demonstrate how to use different kind of gestures on an UIImageView. Of course it can be extended to any other custom UIView as well.

Gestures experimented:


1. Tap 2. Double Tap 3. Triple Tap 4. Long Press 5. Pan 6. Rotate 7. Pinch
To try out these gesture in a simulator, you would simply do as the gesture name suggests.
For the Pan, click and move up/down/left/right.
The rotate and pinch gesture are kind of tricky. You would have to hold down the "option" key and you will see two small circles pop to show your interaction. For pinch you can just move it however you like to see zooming work. For rotate, you have to make sure that when you are moving it the distance between the two circles remain the same for the effect to kick in.

Screenshots of the Shapes:


Circles Image

Squares Image

Triangles Image

A Custom Shape Image

Everything Together Image


As you can see from the screenshots, the circles and squares are created at the same point. Same thing goes for the triangles too, all at the same point. This is because, while trying to make a double or triple tap, it still get registered as a single tap and double tap respectively. Hence, all three shapes pop up. For it to recongnize the taps precisely, you would have to write a custom gesture recognizer function with delay in it. This is also the reason, I haven't included the Swipe gesture since it doesn't work with the Pan gesture (or at least at the time of writing this) the way I have implemented it.
Also if you need to understand how UIBezierPath works, the shape drawing functions would be a good starting point. And then there's always the official documentation.

shape_and_gestures_ios_app's People

Contributors

moon05 avatar

Stargazers

 avatar

Watchers

 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.