This file contains hidden or 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
//overriding delegates | |
private var delegate: SubclassDelegate? | |
override var superclassDelegate: SuperclassDelegate? { | |
didSet { | |
delegate = superclassDelegate as? SubclassDelegate | |
} | |
} | |
//Testing types with switch http://stackoverflow.com/a/25724652/3191130 | |
for thing in things { |
This file contains hidden or 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
#import "ColorBlendTileOverlayRenderer.h" | |
#import "Colors.h" | |
@implementation ColorBlendTileOverlayRenderer | |
-(void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context { | |
[super drawMapRect:mapRect zoomScale:zoomScale inContext:context]; | |
CGRect rect = [self rectForMapRect:mapRect]; |
This file contains hidden or 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
+(BOOL)randomBool { | |
int tmp = (arc4random() % 30)+1; | |
if(tmp % 5 == 0) | |
return YES; | |
return NO; | |
} | |
+(int)randomNumberInRangeMin:(int)min max:(int)max { | |
return rand() % (max - min) + min; | |
} |