Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 931991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:35:29+00:00 2026-05-15T20:35:29+00:00

I am developing an iPhone application and worked with UIWebViews. I planned to customize

  • 0

I am developing an iPhone application and worked with UIWebViews. I planned to customize the UIMenuItems thats popped up when i highlight strings in UiWebView (Copy, Select All, Cut, etc.). I tried removing those menuItems but i cannot remove the COPY menu item.

I need your help guys.

Thanks,
ZaldzBugz

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T20:35:29+00:00Added an answer on May 15, 2026 at 8:35 pm

    You’re going to have to do some hijacking. I don’t even know if it is possible. It looks like it probably responds to a gesture event called UILongPressGestureRecognizer.

    You need to find out what view has the gesture added to it. something like this.

    NSArray *gestures = myWebView.gestureRecognizers;
    for(int i=0;i<[gestures count];i++){
        UIGestureRecognizer g = [gestures objectAtIndex:i];
        if([g isKindOfClass:UILongPressGestureRecognizer.Class]){
           [myWebView removeGestureRecognizer:g];
           break;
        }
    }
    

    but I don’t think the gesture is on the UIWebview directly. It is on one of its subviews.

    So it might be on this subview

    UIScrollView *sview = [[mywebview subviews] objectAtIndex:0];
    

    If not on that one then it is probably on the view that is on top the most, which is what I suspect. It is an undocumented View type, but if you treat it as a UIView for the methods we are calling, it is presumably safe. Also, because you are treating it as a UIView, it isn’t against the rules as far as I understand.

    UIScrollView *sview = [[mywebview subviews] objectAtIndex:0];
    UIView *realWebView = [[sview subviews] objectAtIndex:10];
    

    The reason I didn’t write the snippet (which is untested) to try to remove the gesture from all of the views is because it is important you know which view you remove it from.

    After you remove it, you need to write your own UILongPressGestureRecognizer and then add the new one to the respective view (the view it was removed from).

    You have lost all your functionality of copy select etc… but now you can implement your own.

    If you want some of the old functionality, I think I know how you can get it back, but I can’t promise this is allowed or safe.

    Before you remove the gesture you need to override a method to UIView. You should be able to do it in your current working class file (at the top of the file)

    @implementation UIView (extended)
         -(BOOL) respondsToSelector:(SEL)aSelector {
              printf("SELECTOR: %s\n", 
                [NSStringFromSelector(aSelector) UTF8String]);
    
              return [super respondsToSelector:aSelector];
         }
    @end
    

    I can’t promise anything, but this should log the name of EVERY method that is called in your view.

    Run your app and execute the copy,paste,select,select all methods. Your log should show what methods get called when you press the buttons. It may show several methods when you push a button, you probably just want the first.

    Now when you create a menuItem you know what selector to assign to it.

    This is all just a guess. Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an iPhone application for a university project and I'm new to
I am developing an iPhone application, in which i need to write characters scan
I am developing an iPhone application in which I am fetching data from a
I am developing an iPhone application in which I am loading lots of data
I'm developing an iPhone application that have a TabBarController with two tabs. Each tab
I am developing an iPhone application in which I want to show nearest restaurants
I'm developing an iPhone application where I wish to authenticate (login form) on a
I am developing an iPhone application that retrieves the data from remote MySQL server.
I am developing an iPhone application and I use HTML to display formatted text.
I'm currently developing an iPhone application, and when it comes to compiling, I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.