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 09-27-2009, 05:19 PM   #23 (permalink)
slahteine
Programming Wizard
 
slahteine's Avatar
 
Join Date: Oct 2008
Location: Northampton, MA USA
Age: 45
Posts: 193
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.
__________________
|
| I wrote ChordCalc ... A cool fretboard calculator.
|


Last edited by slahteine; 09-27-2009 at 05:22 PM.
slahteine is offline   Reply With Quote
 

» Advertisements
» Online Users: 549
18 members and 531 guests
306Designs, Dani77, diegosales, djohnson, GameViewPoint, gogoman, jadebair24, JasonR, jbro, LiquidFire, mer10, mohamed khairy hassa, Oral B, Phi, skrew88, themathminister, VinceYuan, WChambers
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,751
Threads: 89,202
Posts: 380,574
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jadebair24
Powered by vBadvanced CMPS v3.1.0

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