Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CLRegion deprecation warnings #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions SVGeocoder/SVGeocoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ typedef void (^SVGeocoderCompletionHandler)(NSArray *placemarks, NSHTTPURLRespon

+ (SVGeocoder*)geocode:(NSString *)address completion:(SVGeocoderCompletionHandler)block;

+ (SVGeocoder*)geocode:(NSString *)address region:(CLRegion *)region completion:(SVGeocoderCompletionHandler)block;
+ (SVGeocoder*)geocode:(NSString *)address region:(CLCircularRegion *)region completion:(SVGeocoderCompletionHandler)block;
+ (SVGeocoder*)geocode:(NSString *)address components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;
+ (SVGeocoder*)geocode:(NSString *)address region:(CLRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;
+ (SVGeocoder*)geocode:(NSString *)address region:(CLCircularRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;

+ (SVGeocoder*)reverseGeocode:(CLLocationCoordinate2D)coordinate completion:(SVGeocoderCompletionHandler)block;

- (SVGeocoder*)initWithAddress:(NSString *)address completion:(SVGeocoderCompletionHandler)block;

- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLRegion *)region completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLCircularRegion *)region completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithAddress:(NSString *)address components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;
- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLCircularRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block;


- (SVGeocoder*)initWithCoordinate:(CLLocationCoordinate2D)coordinate completion:(SVGeocoderCompletionHandler)block;
Expand Down
12 changes: 6 additions & 6 deletions SVGeocoder/SVGeocoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (void)addParametersToRequest:(NSMutableDictionary*)parameters;

- (void)finish;
- (NSString*)createComponentsStringFromDictionary:(NSDictionary *)components;
- (NSString*)createBoundsStringFromRegion:(CLRegion *)region;
- (NSString*)createBoundsStringFromRegion:(CLCircularRegion *)region;

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error;

Expand Down Expand Up @@ -77,7 +77,7 @@ + (SVGeocoder *)geocode:(NSString *)address completion:(SVGeocoderCompletionHand
return geocoder;
}

+ (SVGeocoder *)geocode:(NSString *)address region:(CLRegion *)region completion:(SVGeocoderCompletionHandler)block {
+ (SVGeocoder *)geocode:(NSString *)address region:(CLCircularRegion *)region completion:(SVGeocoderCompletionHandler)block {
SVGeocoder *geocoder = [[self alloc] initWithAddress:address region:region completion:block];
[geocoder start];
return geocoder;
Expand All @@ -89,7 +89,7 @@ + (SVGeocoder*)geocode:(NSString *)address components:(NSDictionary *)components
return geocoder;
}

+ (SVGeocoder*)geocode:(NSString *)address region:(CLRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block {
+ (SVGeocoder*)geocode:(NSString *)address region:(CLCircularRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block {
SVGeocoder *geocoder = [[self alloc] initWithAddress:address region:region components:components completion:block];
[geocoder start];
return geocoder;
Expand Down Expand Up @@ -124,7 +124,7 @@ - (SVGeocoder*)initWithAddress:(NSString*)address completion:(SVGeocoderCompleti
return [self initWithParameters:parameters completion:block];
}

- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLRegion *)region completion:(SVGeocoderCompletionHandler)block {
- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLCircularRegion *)region completion:(SVGeocoderCompletionHandler)block {
NSString *bounds = [self createBoundsStringFromRegion:region];

NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:
Expand All @@ -144,7 +144,7 @@ - (SVGeocoder*)initWithAddress:(NSString *)address components:(NSDictionary *)co
return [self initWithParameters:parameters completion:block];
}

- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block {
- (SVGeocoder*)initWithAddress:(NSString *)address region:(CLCircularRegion *)region components:(NSDictionary *)components completion:(SVGeocoderCompletionHandler)block {
NSString *bounds = [self createBoundsStringFromRegion:region];
NSString *componentsValue = [self createComponentsStringFromDictionary:components];

Expand Down Expand Up @@ -219,7 +219,7 @@ - (NSString*)createComponentsStringFromDictionary:(NSDictionary *)components {
return componentsValue;
}

- (NSString*)createBoundsStringFromRegion:(CLRegion *)region {
- (NSString*)createBoundsStringFromRegion:(CLCircularRegion *)region {
MKCoordinateRegion coordinateRegion = MKCoordinateRegionMakeWithDistance(region.center, region.radius, region.radius);

NSString *bounds = [NSString stringWithFormat:@"%f,%f|%f,%f",
Expand Down