Skip to content

Instantly share code, notes, and snippets.

@lxcid
Created June 20, 2012 06:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lxcid/2958512 to your computer and use it in GitHub Desktop.
Save lxcid/2958512 to your computer and use it in GitHub Desktop.
IRGeoInterceptor patch.
- (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;
}
// 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