Search code examples
iphonexcodeuiwebview

Is there any way to find gesture recognizer in UIWebView


I am trying ebook reading app. In that I want create UIActionSheet by clicking on the index page link..For that how can I identify the touch event in webView as WebView already have the inbuilt longTouch event. Is there any way to identify that longtouch event in webView?


Solution

  • Just overwrite below method to work our gerstures

      - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer
            *)otherGestureRecognizer
       {
            return YES;
       }
    
            For adding longPress add to your view
    
    
    
    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
    longPress.minimumPressDuration=0.8;
    longPress.delegate = self;
    [self addGestureRecognizer:longPress];
    [longPress release];
    
    - (void)longPress:(UILongPressGestureRecognizer*)gesture 
    {
    }