Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 04-29-2009, 12:37 PM   #1 (permalink)
blackspiderman
New Member
 
Join Date: Sep 2008
Posts: 6
Default Zoom in/out gesture UIView

Hi, i've been trying to capture gesture zoom in/out in a UIView.

Code:
UITouch *first = twoTouches objectAtIndex:0;
UITouch *second = twoTouches objectAtIndex:1;
CGPoint firstPoint = first locationInView:self;
CGPoint secondPoint = second locationInView:self;
CGFloat initialDistance = distanceBetweenPoints(firstPoint, secondPoint);

I'm using the function distanceBetweenPoints, the problem is that firstPoint or secondPoint always is 0.00, 0.00 and for that reason the result is the value of one of them.

I need that the booth values should be distint to zero for obtain the real distance.

The frame of the view is: (0, 0, 320, 417).

The functionality that i'm developing is something like zoom in/out of google maps.

Thanks,
blackspiderman is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,798
Threads: 89,205
Posts: 380,608
Top Poster: BrianSlick (7,129)
Welcome to our newest member, Frasier2027
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:52 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.