Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Chris230291

macrumors member
Original poster
Feb 22, 2011
90
0
hi. so i have a webview app that loads a site, but i have no toolbars ect. instead i want a one finger swipe (left and right) to go forwards and backwards. so i drag 2 swipe gesture recogniser objects into interface builder. i click and drag them to the webview and select an action. i then set the number of fingers and direction.

when i try the app the gestures dont recognise. my guess (as a complete beginner) is that it doesn't work because the one finger slide gestures are already used in the webview (though they are NOT required). so what can i do to accomplish my goal of using single finger swipe gestures (left and right) to go forwards and backwards in the webview? do i need to disable the gestures in the webview somehow?

what are my options?
Thanks in advance,
Chris
 
Last edited:
UIWebview is a subclass of UIScrollView. Scroll views intercept single finger swipes for scrolling. I suspect the only way round this will be to subclass UIWebview and override this behaviour.
 
OK cool, it sounds like you know what your on about. how would i go about doing this?

thanks
Chris
 
Which part? This is not something you do in Interface Builder. You will have to write code. Subclassing is a core part of Object Oriented programming which you should know how to do.
 
im a complete beginner and know no code. i have gotten as far as an app that works on my iphone through tutorials and quick google searches.

i saw the gesture recognisers in the list and thought it would just work the same as the toolbar and buttons used in tutorials i've watched.
 
Then you need to stop and actually learn how to write software. Sorry but it's that simple. Spend a few weeks/months/years learning. The sticky threads at the top of this forum suggest books/websites/tutorials that may help you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.