0

I have a webview in my application. I want to handle when user copies something from web view, my custom method - should be triggered. I have tried following.

I have placed following method in myViewCtr.m file

-(void)copy:(id)sender{
     NSLog(@"hi ! Hello ");
}

But nothing working - what should I do to implement the same ?

halfer
  • 19,824
  • 17
  • 99
  • 186
sagarkothari
  • 24,520
  • 50
  • 165
  • 235

2 Answers2

0

You need to implement -copy: on the responder, not on the controller. So you need to subclass UIWebView and override -copy:.

0

Ahh ! I got something here from this question.

Direct sample from Apple itself.

Theory :)

Community
  • 1
  • 1
sagarkothari
  • 24,520
  • 50
  • 165
  • 235