Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

iOS 5 Development - 26 - Pinch (ZOOOOming)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
569 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Dec 25, 2011

This is about pinch, or how to zoom!

CODE: (implement in your .m file)

- (IBAction)handlePinch:(UIPinchGestureRecognizer *)recognizer { recognizer.view.transform = CGAffineTransformScale(recognizer.view.transform, recognizer.scale, recognizer.scale); recognizer.scale = 1;




}


Check this link for max & min zoom : http://paulsolt.com/2011/03/limiting-uipinchgesturerecognizer-zoom-levels/

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (ProgrammingTutor0)

  • I've added a link to the description , check it out ! (max&min zoom)

  • thanks for the quick reaction. im building an app just from tutorials and havent got a lot of coding (none) knowledge. it would help a lot if you could help me out here. if not, no problem, i will just try to work it out myself.

  • @thenaxxramas666 i advice you to go over objective-C then start with iOS development.. aim for quality .. and u'll get some great results!

  • Could you explain how to put a max. and min. on scaling? Thanks!

  • @thenaxxramas666 hey, you can simply put a condition that tests for the image size.. if the image is less than a certain size then it can't zoom in anymore.. same applies to max zoom

  • Where can I download the code documentation file that you used at 3:22? It seems to be very helpful!!

  • @hjyssg Actually, this is my own private documentation.. i'll make it available for anyone soon :) and i'll support you with a link for that !

see all

All Comments (32)

Sign In or Sign Up now to post a comment!
  • Thank you very much! The file is awesome!!

  • something like this?:

    - (void)pinch:(UIPinchGestureRec­ognizer *)recognizer

    { if (recognizer.state == UIGestureRecognizerStateChange­d ||  recognizer.state == UIGestureRecognizerStateEnded) { if (imageView.scale < yourScaleLimit) { imageView.scale *= recognizer.scale; } recognizer.scale = 1.0; }

    }

  • @vtrunk man add me on skype : dani_arnaout i'll solve ur problems there!

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more