Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well you have to write a category for UIWebView that overrides the canPerformAction method,</p> <pre><code>@implementation UIWebView (DisableCopyPaste) -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { UIMenuController *menuController = [UIMenuController sharedMenuController]; if (menuController) { [UIMenuController sharedMenuController].menuVisible = NO; } return NO; } @end </code></pre> <p>import this category in your .pch file found in the xcode project folder, set break points to test whether the long press event fires this method.</p> <p>FYI this method may be called many times, don't worry it is for the list of options that are available for the particular UI component that the user long presses.</p> <p>For creating a category follow these steps.</p> <p><strong>Click the add button on the bottom of your project's solution browser in Xcode.</strong> <br/></p> <p><img src="https://i.stack.imgur.com/T2z6i.png" alt="enter image description here"></p> <p><strong>Next Select Objective C Category in the options.</strong></p> <p><img src="https://i.stack.imgur.com/d7ypX.png" alt="enter image description here"></p> <p><strong>Next Select UIWebView or type UIWebView in the category for textbox and give any name to the category</strong> <img src="https://i.stack.imgur.com/ioxsT.png" alt="enter image description here"></p> <p><strong>Click Next and save the category on to your project location and copy paste the above function. Voila!.</strong></p> <p><strong>For disabling copy paste or other options in text input placed in HTML see <a href="https://stackoverflow.com/questions/5995210/disabling-user-selection-in-uiwebview">this</a>.</strong></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload