SHARE
TWEET

MKMapView: how to disable base canvas visibility

a guest Nov 10th, 2013 36 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (UIView*) viewToDeactivateInView:(UIView*)view {
  2.     UIView *viewFound = nil;
  3.     if( view && view.subviews && [view.subviews count] > 0 ) {
  4.         for( UIView *currentView in view.subviews ) {
  5.             NSString *className = NSStringFromClass( [currentView class] );
  6.             if( [className isEqualToString:@"VKMapCanvas"] ) {
  7.                 viewFound = currentView;
  8.                 break;
  9.             }
  10.             else {
  11.                 viewFound = [self viewToDeactivateInView:currentView];
  12.                 if( viewFound ) {
  13.                     break;
  14.                 }
  15.             }
  16.         }
  17.     }
  18.     return viewFound;
  19. }
  20.  
  21. - (void) baseMapEnableVisibility:(BOOL)isVisible {
  22.     UIView *targetView = [self viewToDeactivateInView:localMapView];
  23.     if( targetView ) {
  24.         NSLog( @"MAP CANVAS: %@", NSStringFromClass([targetView class]) );
  25.         [targetView.layer setOpacity:(isVisible ? 1.0 : 0.0)];
  26.     }
  27.     else {
  28.         NSLog( @"MAP CANVAS NOT FOUND." );
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top