From c067865e7bcb1f8a8eec483a572fa874e5d15111 Mon Sep 17 00:00:00 2001 From: Jason Wray Date: Fri, 27 Apr 2018 12:25:49 -0400 Subject: [ios, macos] Update minimum deployment versions to iOS 9, macOS 10.11 (#11776) * [ios] Remove iOS 8 conditionals * [ios, macos] Bump pod deployment targets * [ios, macos] Add changelog entries * [ios, macos] Update docs * Remove unnecessary selector-based version checks * Update SQLite note * [ios, macos] Replace lightweight generics macros with direct use Lightweight generics for Foundation collections are available everywhere with the bump to iOS 9 and macOS 10.11. * Update deprecated macOS method --- platform/macos/src/MGLMapView.mm | 50 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'platform/macos/src/MGLMapView.mm') diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 9cab9a76da..42fd24653e 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -149,7 +149,7 @@ public: @property (nonatomic, readwrite) MGLStyle *style; /// Mapping from reusable identifiers to annotation images. -@property (nonatomic) NS_MUTABLE_DICTIONARY_OF(NSString *, MGLAnnotationImage *) *annotationImagesByIdentifier; +@property (nonatomic) NSMutableDictionary *annotationImagesByIdentifier; /// Currently shown popover representing the selected annotation. @property (nonatomic) NSPopover *calloutForSelectedAnnotation; @@ -611,7 +611,7 @@ public: #pragma mark Style -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyle { ++ (NSSet *)keyPathsForValuesAffectingStyle { return [NSSet setWithObject:@"styleURL"]; } @@ -965,7 +965,7 @@ public: #pragma mark Viewport -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingCenterCoordinate { ++ (NSSet *)keyPathsForValuesAffectingCenterCoordinate { return [NSSet setWithObjects:@"latitude", @"longitude", @"camera", nil]; } @@ -1015,7 +1015,7 @@ public: _pendingLongitude = pendingLongitude; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingZoomLevel { ++ (NSSet *)keyPathsForValuesAffectingZoomLevel { return [NSSet setWithObject:@"camera"]; } @@ -1083,7 +1083,7 @@ public: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingDirection { ++ (NSSet *)keyPathsForValuesAffectingDirection { return [NSSet setWithObject:@"camera"]; } @@ -1107,7 +1107,7 @@ public: [self setDirection:_mbglMap->getBearing() + delta animated:animated]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingCamera { ++ (NSSet *)keyPathsForValuesAffectingCamera { return [NSSet setWithObjects:@"latitude", @"longitude", @"centerCoordinate", @"zoomLevel", @"direction", nil]; } @@ -1765,7 +1765,7 @@ public: #pragma mark Annotations -- (nullable NS_ARRAY_OF(id ) *)annotations { +- (nullable NSArray> *)annotations { if (_annotationContextsByAnnotationTag.empty()) { return nil; } @@ -1781,12 +1781,12 @@ public: return [NSArray arrayWithObjects:&annotations[0] count:annotations.size()]; } -- (nullable NS_ARRAY_OF(id ) *)visibleAnnotations +- (nullable NSArray> *)visibleAnnotations { return [self visibleFeaturesInRect:self.bounds]; } -- (nullable NS_ARRAY_OF(id ) *)visibleAnnotationsInRect:(CGRect)rect +- (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect { if (_annotationContextsByAnnotationTag.empty()) { @@ -1852,7 +1852,7 @@ public: } } -- (void)addAnnotations:(NS_ARRAY_OF(id ) *)annotations { +- (void)addAnnotations:(NSArray> *)annotations { if (!annotations) { return; } @@ -1987,7 +1987,7 @@ public: } } -- (void)removeAnnotations:(NS_ARRAY_OF(id ) *)annotations { +- (void)removeAnnotations:(NSArray> *)annotations { if (!annotations) { return; } @@ -2192,12 +2192,12 @@ public: [self didChangeValueForKey:@"selectedAnnotations"]; } -- (NS_ARRAY_OF(id ) *)selectedAnnotations { +- (NSArray> *)selectedAnnotations { id selectedAnnotation = self.selectedAnnotation; return selectedAnnotation ? @[selectedAnnotation] : @[]; } -- (void)setSelectedAnnotations:(NS_ARRAY_OF(id ) *)selectedAnnotations { +- (void)setSelectedAnnotations:(NSArray> *)selectedAnnotations { if (!selectedAnnotations.count) { return; } @@ -2330,7 +2330,7 @@ public: } } -- (void)showAnnotations:(NS_ARRAY_OF(id ) *)annotations animated:(BOOL)animated { +- (void)showAnnotations:(NSArray> *)annotations animated:(BOOL)animated { CGFloat maximumPadding = 100; CGFloat yPadding = (NSHeight(self.bounds) / 5 <= maximumPadding) ? (NSHeight(self.bounds) / 5) : maximumPadding; CGFloat xPadding = (NSWidth(self.bounds) / 5 <= maximumPadding) ? (NSWidth(self.bounds) / 5) : maximumPadding; @@ -2340,7 +2340,7 @@ public: [self showAnnotations:annotations edgePadding:edgeInsets animated:animated]; } -- (void)showAnnotations:(NS_ARRAY_OF(id ) *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated { +- (void)showAnnotations:(NSArray> *)annotations edgePadding:(NSEdgeInsets)insets animated:(BOOL)animated { if ( ! annotations || ! annotations.count) return; mbgl::LatLngBounds bounds = mbgl::LatLngBounds::empty(); @@ -2537,11 +2537,11 @@ public: #pragma mark Overlays -- (nonnull NS_ARRAY_OF(id ) *)overlays +- (nonnull NSArray> *)overlays { if (self.annotations == nil) { return @[]; } - NS_MUTABLE_ARRAY_OF(id ) *mutableOverlays = [NSMutableArray array]; + NSMutableArray> *mutableOverlays = [NSMutableArray array]; [self.annotations enumerateObjectsUsingBlock:^(id _Nonnull annotation, NSUInteger idx, BOOL * _Nonnull stop) { if ([annotation conformsToProtocol:@protocol(MGLOverlay)]) @@ -2557,7 +2557,7 @@ public: [self addOverlays:@[overlay]]; } -- (void)addOverlays:(NS_ARRAY_OF(id ) *)overlays +- (void)addOverlays:(NSArray> *)overlays { #if DEBUG for (id overlay in overlays) { @@ -2571,7 +2571,7 @@ public: [self removeOverlays:@[overlay]]; } -- (void)removeOverlays:(NS_ARRAY_OF(id ) *)overlays { +- (void)removeOverlays:(NSArray> *)overlays { #if DEBUG for (id overlay in overlays) { NSAssert([overlay conformsToProtocol:@protocol(MGLOverlay)], @"Overlay does not conform to MGLOverlay"); @@ -2652,15 +2652,15 @@ public: #pragma mark Data -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(NSPoint)point { +- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point { return [self visibleFeaturesAtPoint:point inStyleLayersWithIdentifiers:nil]; } -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers { +- (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers { return [self visibleFeaturesAtPoint:point inStyleLayersWithIdentifiers:styleLayerIdentifiers predicate:nil]; } -- (NS_ARRAY_OF(id ) *)visibleFeaturesAtPoint:(NSPoint)point inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { +- (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { // Cocoa origin is at the lower-left corner. mbgl::ScreenCoordinate screenCoordinate = { point.x, NSHeight(self.bounds) - point.y }; @@ -2683,15 +2683,15 @@ public: return MGLFeaturesFromMBGLFeatures(features); } -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(NSRect)rect { +- (NSArray> *)visibleFeaturesInRect:(NSRect)rect { return [self visibleFeaturesInRect:rect inStyleLayersWithIdentifiers:nil]; } -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers { +- (NSArray> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers { return [self visibleFeaturesInRect:rect inStyleLayersWithIdentifiers:styleLayerIdentifiers predicate:nil]; } -- (NS_ARRAY_OF(id ) *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { +- (NSArray> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(NSSet *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { // Cocoa origin is at the lower-left corner. mbgl::ScreenBox screenBox = { { NSMinX(rect), NSHeight(self.bounds) - NSMaxY(rect) }, -- cgit v1.2.1 From a365dd11da0f4c41ad793ea1e3db3cef8e3cbce8 Mon Sep 17 00:00:00 2001 From: Fabian Guerra Soto Date: Fri, 4 May 2018 15:09:07 -0400 Subject: [ios, macos] Make NSPredicate+MGLAdditions public. (#11810) --- platform/macos/src/MGLMapView.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'platform/macos/src/MGLMapView.mm') diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 9a9e19c363..5b78dcca14 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -58,7 +58,7 @@ #import "NSURL+MGLAdditions.h" #import "NSColor+MGLAdditions.h" #import "NSImage+MGLAdditions.h" -#import "NSPredicate+MGLAdditions.h" +#import "NSPredicate+MGLPrivateAdditions.h" #import #import -- cgit v1.2.1