Skip to content

Commit

Permalink
Merge pull request #137 from hansemannn/MOD-2171
Browse files Browse the repository at this point in the history
[MOD-2171] Fix annotations crash on iOS 9
  • Loading branch information
AngelkPetkov committed Dec 7, 2015
2 parents 632baa2 + 7bca6eb commit f873d1b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion ios/Classes/TiMapAnnotationProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- (NSString *)title;
- (NSString *)subtitle;

- (UIColor*)pinColor;
- (id)pincolor;
- (BOOL)animatesDrop;

- (UIView*)leftViewAccessory;
Expand Down
4 changes: 2 additions & 2 deletions ios/Classes/TiMapAnnotationProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ -(void)setSubtitle:(id)subtitle
}
}

- (UIColor*)pinColor
-(id)pincolor
{
return [TiUtils intValue:[self valueForUndefinedKey:@"pincolor"]];
return [TiUtils intValue:[self valueForUndefinedKey:@"pincolor"]];
}

-(void)setPincolor:(id)color
Expand Down
10 changes: 0 additions & 10 deletions ios/Classes/TiMapModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,10 @@ -(TiMapCameraProxy*)createCamera:(id)args
MAKE_SYSTEM_PROP(HYBRID_FLYOVER_TYPE, MKMapTypeHybridFlyover);
MAKE_SYSTEM_PROP(SATELLITE_FLYOVER_TYPE, MKMapTypeSatelliteFlyover);
#endif
/*
* TODO: Replace with the constants [MKPinAnnotationView redPinColor], [MKPinAnnotationView redPinColor] and [MKPinAnnotationView redPinColor]
* as soon as we make iOS9 as the minimum SDK.
*/

#ifdef __IPHONE_9_0
MAKE_SYSTEM_PROP(ANNOTATION_RED, [MKPinAnnotationView redPinColor]);
MAKE_SYSTEM_PROP(ANNOTATION_GREEN, [MKPinAnnotationView greenPinColor]);
MAKE_SYSTEM_PROP(ANNOTATION_PURPLE, [MKPinAnnotationView purplePinColor]);
#else
MAKE_SYSTEM_PROP(ANNOTATION_RED, MKPinAnnotationColorRed);
MAKE_SYSTEM_PROP(ANNOTATION_GREEN, MKPinAnnotationColorGreen);
MAKE_SYSTEM_PROP(ANNOTATION_PURPLE, MKPinAnnotationColorPurple);
#endif

MAKE_SYSTEM_PROP(ANNOTATION_DRAG_STATE_NONE,MKAnnotationViewDragStateNone);
MAKE_SYSTEM_PROP(ANNOTATION_DRAG_STATE_START,MKAnnotationViewDragStateStarting);
Expand Down
13 changes: 1 addition & 12 deletions ios/Classes/TiMapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -968,18 +968,7 @@ - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnno
else {
MKPinAnnotationView *pinview = (MKPinAnnotationView*)annView;

if([self isIOS9OrGreater] == YES) {
#if __IPHONE_9_0
pinview.pinTintColor = [ann pinColor];
#endif
} else {

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
pinview.pinColor = [ann pinColor];
#pragma GCC diagnostic pop
}

pinview.pinColor = [ann pincolor];
pinview.animatesDrop = [ann animatesDrop] && ![(TiMapAnnotationProxy *)annotation placed];
annView.calloutOffset = CGPointMake(-8, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion ios/manifest
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# this is your module manifest and used by Titanium
# during compilation, packaging, distribution, etc.
#
version: 2.5.0
version: 2.5.1
apiversion: 2
architectures: armv7 arm64 i386 x86_64
description: External version of Map module
Expand Down
2 changes: 1 addition & 1 deletion ios/titanium.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR
//
//
TITANIUM_SDK_VERSION = 5.0.2.GA
TITANIUM_SDK_VERSION = 5.1.0.GA


//
Expand Down

0 comments on commit f873d1b

Please sign in to comment.