Created
June 20, 2012 06:56
-
-
Save lxcid/2958512 to your computer and use it in GitHub Desktop.
IRGeoInterceptor patch.
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
- (IRGeoInterceptor *)interceptorWithDelegate:(id<MKMapViewDelegate>)theDelegate { | |
if (_interceptor == nil) { | |
_interceptor = [[IRGeoInterceptor alloc] init]; | |
_interceptor.middleMan = self; | |
_interceptor.receiver = theDelegate; | |
[super setDelegate:(id<MKMapViewDelegate>)_interceptor]; | |
} | |
return _interceptor; | |
} | |
- (id)initWithFrame:(CGRect)theFrame delegate:(id<MKMapViewDelegate>)theDelegate { | |
self = [super initWithFrame:theFrame]; | |
if (self) { | |
[self interceptorWithDelegate:theDelegate]; | |
[self listeners]; | |
} | |
return self; | |
} |
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
// Cleaner version. | |
- (void) setDelegate:(id<MKMapViewDelegate>)delegate { | |
_interceptor.receiver = delegate; | |
[super setDelegate:nil]; | |
[super setDelegate:(id<MKMapViewDelegate>)_interceptor]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment