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

sdkIQ for iPhone
($4.99)

Your First iPhone App
($1.99)

iPhone Code Generator
($9.99)

Dual Matches
($0.99)

Calcuccino Programmers' Calculator
($2.99)

SDKtoday
(free)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-29-2009, 11:37 AM   #1 (permalink)
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
Old 04-30-2009, 09:06 AM   #2 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 6
Default problem solved

I found the answer.

The problem was that the uiview need it the attribute self.multipleTouchEnabled = YES;

For that reason the multitouch worked but not so well.

Thanks,
blackspiderman is offline   Reply With Quote
Reply

Bookmarks

Tags
multitouch event, uiview, zoom in, zoom out

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


» Advertisements
» Stats
Members: 41,860
Threads: 49,768
Posts: 213,054
Top Poster: BrianSlick (3,138)
Welcome to our newest member, gustavo7sexton
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:55 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0