Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 09-27-2009, 04:19 PM   #23 (permalink)
slahteine
Programming Wizard
 
slahteine's Avatar
 
Join Date: Oct 2008
Location: Northampton, MA USA
Age: 43
Posts: 187
Send a message via AIM to slahteine Send a message via Yahoo to slahteine Send a message via Skype™ to slahteine
Default

Your code in hitTest isn't doing anything useful, so you might as well drop that. The property you're setting there is sticky, you can just set it on your scroll view and leave it set.

However, you DON'T want to set delaysContentTouches to YES, because it will only allow touch-up events to be detected in your subviews. That's why your web view can only receive simple taps, and not swipes.

Instead, set canCancelContentTouches=YES and delaysContentTouches=NO, then implement -touchesShouldCancelInContentView: on your scrollview. This is called the moment you do anything that could scroll the view. You should return YES if you want to allow the scroll to happen, and NO if you want to prevent it.

Since you have subviews inside your scrollview that want to receive swipes and things, you can simply set a BOOL flag (e.g., a global var or a property in your scrollview) to NO whenever one of those subviews receives any touch event, then return that flag from touchesShouldCancelInContentView:. When your subview is done ( receives -touchesEndedWithEvent: ) reset the flag to YES to reallow scrolling.

Either way, touchesShouldCancelInContentView: is the key.
__________________
|
| Why wait? ChordCalc 1.0.4 ... Hundreds sold worldwide !
|


Last edited by slahteine; 09-27-2009 at 04:22 PM.
slahteine is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,292
Threads: 39,080
Posts: 171,361
Top Poster: smasher (2,575)
Welcome to our newest member, omerk
Powered by vBadvanced CMPS v3.1.0

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