Skip to content

Instantly share code, notes, and snippets.

View bennythemink's full-sized avatar

Benny Sheerin bennythemink

  • Melbourne Australia
View GitHub Profile
@protocol KmlDownloaderProtocol <NSObject>
- (void) downloadFileFrom:(NSString*)urlString isAsyncDownload:(BOOL)isAsync;
- (NSURL*) urlForKmlFile;
@end
@interface KmlDownloader : NSObject <KmlDownloaderProtocol>
@bennythemink
bennythemink / gist:ec7bf376c280b2cf1dd1
Created July 17, 2014 06:02
Small but handy NSString extension for checking if the string is a valid email address or is a valid number
@interface NSString (Extension)
- (BOOL) isAnEmail;
- (BOOL) isNumeric;
@end
@implementation NSString (Extension)
/**
- (IBAction) didEnterSearchTerm:(id)sender {
if ([self.searchTxt.text length] == 0) return;
[self displayLoadingViewAndDisableUI];
// contact Apple for geocode
CLGeocoder *geoCoder = [[CLGeocoder alloc] init];
// User enters a search term (e.g. springfield united states of america) and Apple's server responds with an array of placemarks that
// match the entered search term.