Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 719985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:42:24+00:00 2026-05-14T05:42:24+00:00

Is there any code example teaching how to zoom in and out in a

  • 0

Is there any code example teaching how to zoom in and out in a UIImageView by user taps?

I know it is possible to do it with UIScrollView and with UIWebView, but these solutions both need a lot of changes in my code, and I’m working on schedule due to college project deadlines.

I want basically an example on how to manipulate directly the UIImageView, having the same behavior as the photo album in iPhone:

  • first double touch -> zoom in
  • second double touch -> zoom out
  • pinch and zoom with “two-fingered” multi-touch

Thanks a lot!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:42:24+00:00Added an answer on May 14, 2026 at 5:42 am

    I’m not sure that rolling your own solution is going to be simpler than UIScrollView or UIWebView. If you have your heart set on rolling your own solution, however, it can be done with custom event handling and changing the frame of the UIImageView. You will need to process touch events on the UIImageView (or its container) by overriding the following methods:

    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
    - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
    - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
    

    You will need to distinguish between taps and pinches in these methods and set the frame of the UIImageView accordingly. Remember that frame is an animatable property of UIView, so you can also animate these changes.

    If you don’t already have an idea of how you’re going to process events in these methods, then I strongly suggest that you reconsider using UIScrollView or UIWebView to do what you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any code beautifier formatter for Sass (SCSS) code? I know how to
Greeting Is there any example code to show how to stream video over ip
Is there any OpenGL, OpenGL ES or WebGL code example on the web how
Is there any example code for something like that (and somehow changing the URL
is there any example code of setting up tinymce within your web application using
Is there any example code of a cpython (not IronPython) client which can call
Is there any sample application or code example for uploading image to picasa using
Is there any code example of a desktop application how to authorize to Google
Is there any code or custom options available to achieve the following : 1>
Is there any program code that can help me to pop up the virtual

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.