0

From the list of available UIScrollview delegate list . I want to restrict a selective uiscrollview delegate function namely:

(UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView;

I want to restrict it from calling by the compiler . can i accomplish this . Any suggestions & help are appreciated!!

Nate
  • 31,017
  • 13
  • 83
  • 207
itechnician
  • 1,645
  • 1
  • 14
  • 24

1 Answers1

0

As mentioned previously you can assign a tag to each of your UIScrollViews (or just the one you need), and then check for that specific tag, or you can compare the UIScrollView in your delegate methods to the one you are interested in.

With tags.

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
if(scrollView.tag == 100){
   //do something here
   return imgView;
}
return nil;
} 

Comparing scrollViews.

- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
if([myScrollView isEqual:scrollView]){
  //do something here
   return imgView;
}
return nil;

}
ohr
  • 1,717
  • 14
  • 15