Guest User

MKMapView: how to disable base canvas visibility

a guest
Nov 10th, 2013
51
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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×