Created
January 13, 2016 20:29
-
-
Save colbylwilliams/87dfab1ea4fb302ecaa7 to your computer and use it in GitHub Desktop.
UIWebView subclass that only displays Copy & Paste
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Foundation; | |
using UIKit; | |
using CoreGraphics; | |
using ObjCRuntime; | |
using MobileCoreServices; | |
namespace WebViewExample.iOS | |
{ | |
public class CustomWebView : UIWebView | |
{ | |
public CustomWebView (CGRect frame) : base(frame) | |
{ | |
} | |
public override bool CanPerform (Selector action, NSObject withSender) | |
{ | |
return action.Name.Equals("copy:") || (action.Name.Equals("paste:") && UIPasteboard.General.Contains(new string[] { UTType.Text })); | |
} | |
} | |
} |
it's does not work still all menu comes (copy, paste, define, select etc.).
hi any update on above
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it's does not work please check my above sample class.