Hi All ! Sometimes, Developer may want to restrict users to copy some data from their app.
Most of the time, for displaying rich-media-contents, developers use UIWebView.
But UIWebView comes with default behaviors. We eliminated one of the default behavior in previous post.
In this post, I will illustrate how to hide UIMenu quickly as soon as it appears.
I search a lot, but I didn’t find any legal way. I come up with a trick & following code snip works like hack.
It hides menu as soon as it get displayed. So, user won’t get a chance to copy data.
By doing this, Developer may restrict user to copy important application data.
Hope this is going to help some-one someday.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(processit:) name:UIMenuControllerWillShowMenuNotification object:nil];
UIMenuController *menu = [UIMenuController sharedMenuController];
[menu performSelector:@selector(setMenuVisible:) withObject:[NSNumber numberWithBool:NO] afterDelay:0.15];
Cheers. Hope you like it.