xcode help with webview and gestures.

Discussion in 'iOS Programming' started by Chris230291, Nov 24, 2011.

  1. Chris230291, Nov 24, 2011
    Last edited: Nov 24, 2011

    Chris230291 macrumors member

    Joined:
    Feb 22, 2011
    #1
    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
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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.
     
  3. Chris230291 thread starter macrumors member

    Joined:
    Feb 22, 2011
    #3
    OK cool, it sounds like you know what your on about. how would i go about doing this?

    thanks
    Chris
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    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.
     
  5. Chris230291 thread starter macrumors member

    Joined:
    Feb 22, 2011
    #5
    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.
     
  6. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #6
    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.
     
  7. Chris230291 thread starter macrumors member

    Joined:
    Feb 22, 2011
  8. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #8
    Elapsed time: 1 hr 7 mins. That was quick.
     
  9. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #9
    This entire topic made me laugh. sorry.
     

Share This Page