Created
September 12, 2010 20:05
-
-
Save AlexAstroCat/576388 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MKMapView+Additions.h | |
// ParkingMobility | |
// | |
// Created by Michael Nachbaur on 10-09-12. | |
// Copyright 2010 Decaf Ninja Software. All rights reserved. | |
// | |
#import <MapKit/MapKit.h> | |
@interface MKMapView (Additions) | |
- (UIImageView*)googleLogo; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// MKMapView+Additions.m | |
// ParkingMobility | |
// | |
// Created by Michael Nachbaur on 10-09-12. | |
// Copyright 2010 Decaf Ninja Software. All rights reserved. | |
// | |
#import "MKMapView+Additions.h" | |
@implementation MKMapView (Additions) | |
- (UIImageView*)googleLogo { | |
UIImageView *imgView = nil; | |
for (UIView *subview in self.subviews) { | |
if ([subview isMemberOfClass:[UIImageView class]]) { | |
imgView = (UIImageView*)subview; | |
break; | |
} | |
} | |
return imgView; | |
} | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** SNIP ***/ | |
#import "MKMapView+Additions.h" | |
- (void)viewDidAppear:(BOOL)animated { | |
[self relocateGoogleLogo]; | |
} | |
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { | |
[self relocateGoogleLogo]; | |
} | |
- (void)relocateGoogleLogo { | |
UIImageView *logo = [_mapView googleLogo]; | |
if (logo == nil) | |
return; | |
CGRect frame = logo.frame; | |
frame.origin.y = _toolbar.frame.origin.y - frame.size.height - frame.origin.x; | |
logo.frame = frame; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment