Skip to content

@NachoMan /MKMapView+Additions.h
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
//
// 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
//
// 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
/*** 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
Something went wrong with that request. Please try again.