Skip to content

Add better subclassing support to PFGeoPoint. #66

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

Merged
merged 1 commit into from
Aug 21, 2015
Merged
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
2 changes: 1 addition & 1 deletion Parse/Internal/PFGeoPointPrivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ extern const double EARTH_RADIUS_KILOMETERS;
/*!
Creates an GeoPoint from its encoded format.
*/
+ (PFGeoPoint *)geoPointWithDictionary:(NSDictionary *)dictionary;
+ (instancetype)geoPointWithDictionary:(NSDictionary *)dictionary;

@end
6 changes: 3 additions & 3 deletions Parse/PFGeoPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ typedef void(^PFGeoPointResultBlock)(PFGeoPoint *PF_NULLABLE_S geoPoint, NSError

@returns Returns a new `PFGeoPoint`.
*/
+ (PFGeoPoint *)geoPoint;
+ (instancetype)geoPoint;

/*!
@abstract Creates a new `PFGeoPoint` object for the given `CLLocation`, set to the location's coordinates.
Expand All @@ -44,7 +44,7 @@ typedef void(^PFGeoPointResultBlock)(PFGeoPoint *PF_NULLABLE_S geoPoint, NSError

@returns Returns a new PFGeoPoint at specified location.
*/
+ (PFGeoPoint *)geoPointWithLocation:(PF_NULLABLE CLLocation *)location;
+ (instancetype)geoPointWithLocation:(PF_NULLABLE CLLocation *)location;

/*!
@abstract Create a new `PFGeoPoint` object with the specified latitude and longitude.
Expand All @@ -54,7 +54,7 @@ typedef void(^PFGeoPointResultBlock)(PFGeoPoint *PF_NULLABLE_S geoPoint, NSError

@returns New point object with specified latitude and longitude.
*/
+ (PFGeoPoint *)geoPointWithLatitude:(double)latitude longitude:(double)longitude;
+ (instancetype)geoPointWithLatitude:(double)latitude longitude:(double)longitude;

/*!
@abstract Fetches the current device location and executes a block with a new `PFGeoPoint` object.
Expand Down
10 changes: 5 additions & 5 deletions Parse/PFGeoPoint.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ @implementation PFGeoPoint
#pragma mark - Init
///--------------------------------------

+ (PFGeoPoint *)geoPoint {
+ (instancetype)geoPoint {
return [[self alloc] init];
}

+ (PFGeoPoint *)geoPointWithLocation:(CLLocation *)location {
+ (instancetype)geoPointWithLocation:(CLLocation *)location {
return [self geoPointWithLatitude:location.coordinate.latitude
longitude:location.coordinate.longitude];
}

+ (PFGeoPoint *)geoPointWithLatitude:(double)latitude longitude:(double)longitude {
PFGeoPoint *gpt = [PFGeoPoint geoPoint];
+ (instancetype)geoPointWithLatitude:(double)latitude longitude:(double)longitude {
PFGeoPoint *gpt = [self geoPoint];
gpt.latitude = latitude;
gpt.longitude = longitude;
return gpt;
Expand Down Expand Up @@ -111,7 +111,7 @@ - (NSDictionary *)encodeIntoDictionary {
};
}

+ (PFGeoPoint *)geoPointWithDictionary:(NSDictionary *)dictionary {
+ (instancetype)geoPointWithDictionary:(NSDictionary *)dictionary {
return [[self alloc] initWithEncodedDictionary:dictionary];
}

Expand Down