Authored by Justin R. Miller

update to modern use of `instancetype`

... ... @@ -122,7 +122,7 @@
* @param aCoordinate The location for the annotation.
* @param aTitle The annotation's title.
* @return An annotation object, or `nil` if an annotation was unable to be created. */
+ (id)annotationWithMapView:(RMMapView *)aMapView coordinate:(CLLocationCoordinate2D)aCoordinate andTitle:(NSString *)aTitle;
+ (instancetype)annotationWithMapView:(RMMapView *)aMapView coordinate:(CLLocationCoordinate2D)aCoordinate andTitle:(NSString *)aTitle;
/** Initialize an annotation.
* @param aMapView The map view on which to place the annotation.
... ...
... ... @@ -55,7 +55,7 @@
@synthesize clusteredAnnotations;
@synthesize isUserLocationAnnotation;
+ (id)annotationWithMapView:(RMMapView *)aMapView coordinate:(CLLocationCoordinate2D)aCoordinate andTitle:(NSString *)aTitle
+ (instancetype)annotationWithMapView:(RMMapView *)aMapView coordinate:(CLLocationCoordinate2D)aCoordinate andTitle:(NSString *)aTitle
{
return [[self alloc] initWithMapView:aMapView coordinate:aCoordinate andTitle:aTitle];
}
... ...
... ... @@ -49,7 +49,7 @@
* @param aTile The tile key for the object.
* @param aCacheKey The unique identifier for the cache.
* @return A newly created cache object. */
+ (id)cacheObject:(id)anObject forTile:(RMTile)aTile withCacheKey:(NSString *)aCacheKey;
+ (instancetype)cacheObject:(id)anObject forTile:(RMTile)aTile withCacheKey:(NSString *)aCacheKey;
/** Initializes and returns a newly allocated cache object for a given key and object to store in a given cache.
* @param anObject The object to cache, typically a UIImage.
... ...
... ... @@ -42,7 +42,7 @@
@synthesize tile = _tile;
@synthesize timestamp = _timestamp;
+ (id)cacheObject:(id)anObject forTile:(RMTile)aTile withCacheKey:(NSString *)aCacheKey
+ (instancetype)cacheObject:(id)anObject forTile:(RMTile)aTile withCacheKey:(NSString *)aCacheKey
{
return [[self alloc] initWithObject:anObject forTile:aTile withCacheKey:aCacheKey];
}
... ...
... ... @@ -34,7 +34,7 @@
/** Access the shared instance of the configuration.
* @return The shared configuration instance. */
+ (RMConfiguration *)configuration;
+ (instancetype)configuration;
- (RMConfiguration *)initWithPath:(NSString *)path;
... ... @@ -65,7 +65,7 @@
@interface NSData (RMUserAgent)
+ (NSData *)brandedDataWithContentsOfURL:(NSURL *)aURL;
+ (instancetype)brandedDataWithContentsOfURL:(NSURL *)aURL;
@end
... ... @@ -73,6 +73,6 @@
@interface NSString (RMUserAgent)
+ (id)brandedStringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error;
+ (instancetype)brandedStringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error;
@end
... ...
... ... @@ -46,7 +46,7 @@ static RMConfiguration *RMConfigurationSharedInstance = nil;
@implementation NSData (RMUserAgent)
+ (NSData *)brandedDataWithContentsOfURL:(NSURL *)aURL
+ (instancetype)brandedDataWithContentsOfURL:(NSURL *)aURL
{
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:aURL];
... ... @@ -61,7 +61,7 @@ static RMConfiguration *RMConfigurationSharedInstance = nil;
@implementation NSString (RMUserAgent)
+ (id)brandedStringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error
+ (instancetype)brandedStringWithContentsOfURL:(NSURL *)url encoding:(NSStringEncoding)enc error:(NSError **)error
{
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
... ... @@ -92,7 +92,7 @@ static RMConfiguration *RMConfigurationSharedInstance = nil;
@synthesize userAgent=_userAgent;
+ (RMConfiguration *)configuration
+ (instancetype)configuration
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
... ...
... ... @@ -43,8 +43,8 @@
// applies #wrapPointHorizontally to aPoint, and then clamps northing (Y coordinate) to projection's planetBounds
- (RMProjectedPoint)constrainPointToBounds:(RMProjectedPoint)aPoint;
+ (RMProjection *)googleProjection;
+ (RMProjection *)EPSGLatLong;
+ (instancetype)googleProjection;
+ (instancetype)EPSGLatLong;
- (id)initWithString:(NSString *)proj4String inBounds:(RMProjectedRect)projectedBounds;
... ...
... ... @@ -50,7 +50,7 @@
static RMProjection *_googleProjection = nil;
static RMProjection *_latitudeLongitudeProjection = nil;
+ (RMProjection *)googleProjection
+ (instancetype)googleProjection
{
if (_googleProjection)
{
... ... @@ -66,7 +66,7 @@ static RMProjection *_latitudeLongitudeProjection = nil;
}
}
+ (RMProjection *)EPSGLatLong
+ (instancetype)EPSGLatLong
{
if (_latitudeLongitudeProjection)
{
... ...