diff options
Diffstat (limited to 'platform/ios/src')
-rw-r--r-- | platform/ios/src/MGLAnnotationContainerView.h | 2 | ||||
-rw-r--r-- | platform/ios/src/MGLAnnotationContainerView.m | 4 | ||||
-rw-r--r-- | platform/ios/src/MGLAnnotationContainerView_Private.h | 2 | ||||
-rw-r--r-- | platform/ios/src/MGLMapAccessibilityElement.mm | 6 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.h | 38 | ||||
-rw-r--r-- | platform/ios/src/MGLMapView.mm | 118 | ||||
-rw-r--r-- | platform/ios/src/MGLMapViewDelegate.h | 2 | ||||
-rw-r--r-- | platform/ios/src/MGLScaleBar.mm | 7 | ||||
-rw-r--r-- | platform/ios/src/MGLUserLocation.m | 2 |
9 files changed, 82 insertions, 99 deletions
diff --git a/platform/ios/src/MGLAnnotationContainerView.h b/platform/ios/src/MGLAnnotationContainerView.h index 90d2964831..ccec3052a6 100644 --- a/platform/ios/src/MGLAnnotationContainerView.h +++ b/platform/ios/src/MGLAnnotationContainerView.h @@ -10,7 +10,7 @@ NS_ASSUME_NONNULL_BEGIN + (instancetype)annotationContainerViewWithAnnotationContainerView:(MGLAnnotationContainerView *)annotationContainerView; -- (void)addSubviews:(NS_ARRAY_OF(MGLAnnotationView *) *)subviews; +- (void)addSubviews:(NSArray<MGLAnnotationView *> *)subviews; @end diff --git a/platform/ios/src/MGLAnnotationContainerView.m b/platform/ios/src/MGLAnnotationContainerView.m index 9a823c839c..6c82a1836d 100644 --- a/platform/ios/src/MGLAnnotationContainerView.m +++ b/platform/ios/src/MGLAnnotationContainerView.m @@ -3,7 +3,7 @@ @interface MGLAnnotationContainerView () -@property (nonatomic) NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *annotationViews; +@property (nonatomic) NSMutableArray<MGLAnnotationView *> *annotationViews; @end @@ -26,7 +26,7 @@ return newAnnotationContainerView; } -- (void)addSubviews:(NS_ARRAY_OF(MGLAnnotationView *) *)subviews +- (void)addSubviews:(NSArray<MGLAnnotationView *> *)subviews { for (MGLAnnotationView *view in subviews) { diff --git a/platform/ios/src/MGLAnnotationContainerView_Private.h b/platform/ios/src/MGLAnnotationContainerView_Private.h index 007b03550b..9dce54842d 100644 --- a/platform/ios/src/MGLAnnotationContainerView_Private.h +++ b/platform/ios/src/MGLAnnotationContainerView_Private.h @@ -7,7 +7,7 @@ NS_ASSUME_NONNULL_BEGIN @interface MGLAnnotationContainerView (Private) -@property (nonatomic) NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *annotationViews; +@property (nonatomic) NSMutableArray<MGLAnnotationView *> *annotationViews; @end diff --git a/platform/ios/src/MGLMapAccessibilityElement.mm b/platform/ios/src/MGLMapAccessibilityElement.mm index 8bce38a145..c1cc5304d7 100644 --- a/platform/ios/src/MGLMapAccessibilityElement.mm +++ b/platform/ios/src/MGLMapAccessibilityElement.mm @@ -56,10 +56,8 @@ // may be in the local language, which may be written in another script. // Attempt to transform to the script of the preferred language, keeping // the original string if no transform exists or if transformation fails. - if (@available(iOS 9.0, *)) { - NSString *dominantScript = [NSOrthography mgl_dominantScriptForMapboxStreetsLanguage:languageCode]; - name = [name mgl_stringByTransliteratingIntoScript:dominantScript]; - } + NSString *dominantScript = [NSOrthography mgl_dominantScriptForMapboxStreetsLanguage:languageCode]; + name = [name mgl_stringByTransliteratingIntoScript:dominantScript]; self.accessibilityLabel = name; } diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 020dc5e830..fd0ca19b26 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -189,7 +189,7 @@ MGL_EXPORT IB_DESIGNABLE */ @property (nonatomic, readonly, nullable) MGLStyle *style; -@property (nonatomic, readonly) NS_ARRAY_OF(NSURL *) *bundledStyleURLs __attribute__((unavailable("Call the relevant class method of MGLStyle for the URL of a particular default style."))); +@property (nonatomic, readonly) NSArray<NSURL *> *bundledStyleURLs __attribute__((unavailable("Call the relevant class method of MGLStyle for the URL of a particular default style."))); /** URL of the style currently displayed in the receiver. @@ -286,7 +286,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (IBAction)showAttribution:(id)sender; -@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses __attribute__((unavailable("Support for style classes has been removed."))); +@property (nonatomic) NSArray<NSString *> *styleClasses __attribute__((unavailable("Support for style classes has been removed."))); - (BOOL)hasStyleClass:(NSString *)styleClass __attribute__((unavailable("Support for style classes has been removed."))); @@ -773,7 +773,7 @@ MGL_EXPORT IB_DESIGNABLE @param animated `YES` if you want the map region change to be animated, or `NO` if you want the map to display the new region immediately without animations. */ -- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations animated:(BOOL)animated; +- (void)showAnnotations:(NSArray<id <MGLAnnotation>> *)annotations animated:(BOOL)animated; /** Sets the visible region so that the map displays the specified annotations with @@ -788,7 +788,7 @@ MGL_EXPORT IB_DESIGNABLE @param animated `YES` if you want the map region change to be animated, or `NO` if you want the map to display the new region immediately without animations. */ -- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated; +- (void)showAnnotations:(NSArray<id <MGLAnnotation>> *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated; /** A camera representing the current viewpoint of the map. @@ -1076,7 +1076,7 @@ MGL_EXPORT IB_DESIGNABLE annotations are associated with the map view, the value of this property is `nil`. */ -@property (nonatomic, readonly, nullable) NS_ARRAY_OF(id <MGLAnnotation>) *annotations; +@property (nonatomic, readonly, nullable) NSArray<id <MGLAnnotation>> *annotations; /** Adds an annotation to the map view. @@ -1104,7 +1104,7 @@ MGL_EXPORT IB_DESIGNABLE must conform to the `MGLAnnotation` protocol. The map view retains each individual annotation object. */ -- (void)addAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations; +- (void)addAnnotations:(NSArray<id <MGLAnnotation>> *)annotations; /** Removes an annotation from the map view, deselecting it if it is selected. @@ -1129,7 +1129,7 @@ MGL_EXPORT IB_DESIGNABLE @param annotations The array of annotation objects to remove. Objects in the array must conform to the `MGLAnnotation` protocol. */ -- (void)removeAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations; +- (void)removeAnnotations:(NSArray<id <MGLAnnotation>> *)annotations; /** Returns an `MGLAnnotationView` if the given annotation is currently associated @@ -1180,7 +1180,7 @@ MGL_EXPORT IB_DESIGNABLE annotations are associated with the map view or if no annotations associated with the map view are currently visible, the value of this property is `nil`. */ -@property (nonatomic, readonly, nullable) NS_ARRAY_OF(id <MGLAnnotation>) *visibleAnnotations; +@property (nonatomic, readonly, nullable) NSArray<id <MGLAnnotation>> *visibleAnnotations; /** Returns the list of annotations associated with the receiver that intersect with @@ -1191,7 +1191,7 @@ MGL_EXPORT IB_DESIGNABLE no annotations associated with the map view are currently visible in the rectangle. */ -- (nullable NS_ARRAY_OF(id <MGLAnnotation>) *)visibleAnnotationsInRect:(CGRect)rect; +- (nullable NSArray<id <MGLAnnotation>> *)visibleAnnotationsInRect:(CGRect)rect; #pragma mark Managing Annotation Selections @@ -1208,7 +1208,7 @@ MGL_EXPORT IB_DESIGNABLE @note In versions prior to `4.0.0` if the annotation was offscreen it was not selected. */ -@property (nonatomic, copy) NS_ARRAY_OF(id <MGLAnnotation>) *selectedAnnotations; +@property (nonatomic, copy) NSArray<id <MGLAnnotation>> *selectedAnnotations; /** Selects an annotation and displays its callout view. @@ -1246,7 +1246,7 @@ MGL_EXPORT IB_DESIGNABLE overlays are associated with the map view, the value of this property is empty array. */ -@property (nonatomic, readonly, nonnull) NS_ARRAY_OF(id <MGLOverlay>) *overlays; +@property (nonatomic, readonly, nonnull) NSArray<id <MGLOverlay>> *overlays; /** Adds a single overlay object to the map. @@ -1265,7 +1265,7 @@ MGL_EXPORT IB_DESIGNABLE @param overlays An array of objects, each of which must conform to the `MGLOverlay` protocol. */ -- (void)addOverlays:(NS_ARRAY_OF(id <MGLOverlay>) *)overlays; +- (void)addOverlays:(NSArray<id <MGLOverlay>> *)overlays; /** Removes a single overlay object from the map. @@ -1285,7 +1285,7 @@ MGL_EXPORT IB_DESIGNABLE @param overlays An array of objects, each of which conforms to the `MGLOverlay` protocol. */ -- (void)removeOverlays:(NS_ARRAY_OF(id <MGLOverlay>) *)overlays; +- (void)removeOverlays:(NSArray<id <MGLOverlay>> *)overlays; #pragma mark Accessing the Underlying Map Data @@ -1301,7 +1301,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesAtPoint:(CGPoint)point NS_SWIFT_NAME(visibleFeatures(at:)); +- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point NS_SWIFT_NAME(visibleFeatures(at:)); /** Returns an array of rendered map features that intersect with a given point, @@ -1320,7 +1320,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NS_SET_OF(NSString *) *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:)); +- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:)); /** Returns an array of rendered map features that intersect with a given point, @@ -1387,7 +1387,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:predicate:)); +- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:predicate:)); /** Returns an array of rendered map features that intersect with the given @@ -1402,7 +1402,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesInRect:(CGRect)rect NS_SWIFT_NAME(visibleFeatures(in:)); +- (NSArray<id <MGLFeature>> *)visibleFeaturesInRect:(CGRect)rect NS_SWIFT_NAME(visibleFeatures(in:)); /** Returns an array of rendered map features that intersect with the given @@ -1421,7 +1421,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NS_SET_OF(NSString *) *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:)); +- (NSArray<id <MGLFeature>> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:)); /** Returns an array of rendered map features that intersect with the given @@ -1493,7 +1493,7 @@ MGL_EXPORT IB_DESIGNABLE @return An array of objects conforming to the `MGLFeature` protocol that represent features in the sources used by the current style. */ -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:)); +- (NSArray<id <MGLFeature>> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:)); #pragma mark Debugging the Map diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 71f308caf0..26b23abb4e 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -194,14 +194,14 @@ public: @property (nonatomic) GLKView *glView; @property (nonatomic) UIImageView *glSnapshotView; -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *scaleBarConstraints; +@property (nonatomic) NSMutableArray<NSLayoutConstraint *> *scaleBarConstraints; @property (nonatomic, readwrite) MGLScaleBar *scaleBar; @property (nonatomic, readwrite) UIImageView *compassView; -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *compassViewConstraints; +@property (nonatomic) NSMutableArray<NSLayoutConstraint *> *compassViewConstraints; @property (nonatomic, readwrite) UIImageView *logoView; -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *logoViewConstraints; +@property (nonatomic) NSMutableArray<NSLayoutConstraint *> *logoViewConstraints; @property (nonatomic, readwrite) UIButton *attributionButton; -@property (nonatomic) NS_MUTABLE_ARRAY_OF(NSLayoutConstraint *) *attributionButtonConstraints; +@property (nonatomic) NSMutableArray<NSLayoutConstraint *> *attributionButtonConstraints; @property (nonatomic, readwrite) MGLStyle *style; @@ -217,7 +217,7 @@ public: @property (nonatomic) MGLCameraChangeReason cameraChangeReasonBitmask; /// Mapping from reusable identifiers to annotation images. -@property (nonatomic) NS_MUTABLE_DICTIONARY_OF(NSString *, MGLAnnotationImage *) *annotationImagesByIdentifier; +@property (nonatomic) NSMutableDictionary<NSString *, MGLAnnotationImage *> *annotationImagesByIdentifier; /// Currently shown popover representing the selected annotation. @property (nonatomic) UIView<MGLCalloutView> *calloutViewForSelectedAnnotation; @@ -235,7 +235,7 @@ public: @property (nonatomic) MGLMapViewProxyAccessibilityElement *mapViewProxyAccessibilityElement; @property (nonatomic) MGLAnnotationContainerView *annotationContainerView; @property (nonatomic) MGLUserLocation *userLocation; -@property (nonatomic) NS_MUTABLE_DICTIONARY_OF(NSString *, NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *) *annotationViewReuseQueueByIdentifier; +@property (nonatomic) NSMutableDictionary<NSString *, NSMutableArray<MGLAnnotationView *> *> *annotationViewReuseQueueByIdentifier; @end @@ -287,9 +287,9 @@ public: BOOL _delegateHasLineWidthsForShapeAnnotations; MGLCompassDirectionFormatter *_accessibilityCompassFormatter; - NS_ARRAY_OF(id <MGLFeature>) *_visiblePlaceFeatures; - NS_ARRAY_OF(id <MGLFeature>) *_visibleRoadFeatures; - NS_MUTABLE_SET_OF(MGLFeatureAccessibilityElement *) *_featureAccessibilityElements; + NSArray<id <MGLFeature>> *_visiblePlaceFeatures; + NSArray<id <MGLFeature>> *_visibleRoadFeatures; + NSMutableSet<MGLFeatureAccessibilityElement *> *_featureAccessibilityElements; BOOL _accessibilityValueAnnouncementIsPending; MGLReachability *_reachability; @@ -335,12 +335,12 @@ public: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyle ++ (NSSet<NSString *> *)keyPathsForValuesAffectingStyle { return [NSSet setWithObject:@"styleURL"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyleURL ++ (NSSet<NSString *> *)keyPathsForValuesAffectingStyleURL { return [NSSet setWithObjects:@"styleURL__", nil]; } @@ -624,18 +624,8 @@ public: UIGraphicsBeginImageContextWithOptions(scaleImage.size, NO, [UIScreen mainScreen].scale); [scaleImage drawInRect:{ CGPointZero, scaleImage.size }]; - CGFloat northSize = 11; - UIFont *northFont; - if ([UIFont respondsToSelector:@selector(systemFontOfSize:weight:)]) - { - northFont = [UIFont systemFontOfSize:northSize weight:UIFontWeightUltraLight]; - } - else - { - northFont = [UIFont systemFontOfSize:northSize]; - } NSAttributedString *north = [[NSAttributedString alloc] initWithString:NSLocalizedStringWithDefaultValue(@"COMPASS_NORTH", nil, nil, @"N", @"Compass abbreviation for north") attributes:@{ - NSFontAttributeName: northFont, + NSFontAttributeName: [UIFont systemFontOfSize:11 weight:UIFontWeightUltraLight], NSForegroundColorAttributeName: [UIColor whiteColor], }]; CGRect stringRect = CGRectMake((scaleImage.size.width - north.size.width) / 2, @@ -1273,7 +1263,7 @@ public: } } -- (void)touchesBegan:(__unused NS_SET_OF(UITouch *) *)touches withEvent:(__unused UIEvent *)event +- (void)touchesBegan:(__unused NSSet<UITouch *> *)touches withEvent:(__unused UIEvent *)event { _changeDelimiterSuppressionDepth = 0; _mbglMap->setGestureInProgress(false); @@ -2238,22 +2228,22 @@ public: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingZoomEnabled ++ (NSSet<NSString *> *)keyPathsForValuesAffectingZoomEnabled { return [NSSet setWithObject:@"allowsZooming"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingScrollEnabled ++ (NSSet<NSString *> *)keyPathsForValuesAffectingScrollEnabled { return [NSSet setWithObject:@"allowsScrolling"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingRotateEnabled ++ (NSSet<NSString *> *)keyPathsForValuesAffectingRotateEnabled { return [NSSet setWithObject:@"allowsRotating"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingPitchEnabled ++ (NSSet<NSString *> *)keyPathsForValuesAffectingPitchEnabled { return [NSSet setWithObject:@"allowsTilting"]; } @@ -2419,7 +2409,7 @@ public: return value; } -- (NS_ARRAY_OF(id <MGLFeature>) *)visiblePlaceFeatures +- (NSArray<id <MGLFeature>> *)visiblePlaceFeatures { if (!_visiblePlaceFeatures) { @@ -2429,7 +2419,7 @@ public: return _visiblePlaceFeatures; } -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleRoadFeatures +- (NSArray<id <MGLFeature>> *)visibleRoadFeatures { if (!_visibleRoadFeatures) { @@ -2907,7 +2897,7 @@ public: #pragma mark - Geography - -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingCenterCoordinate ++ (NSSet<NSString *> *)keyPathsForValuesAffectingCenterCoordinate { return [NSSet setWithObjects:@"latitude", @"longitude", @"camera", nil]; } @@ -2998,7 +2988,7 @@ public: _mbglMap->easeTo(cameraOptions, animationOptions); } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingZoomLevel ++ (NSSet<NSString *> *)keyPathsForValuesAffectingZoomLevel { return [NSSet setWithObject:@"camera"]; } @@ -3167,7 +3157,7 @@ public: [self didChangeValueForKey:@"visibleCoordinateBounds"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingDirection ++ (NSSet<NSString *> *)keyPathsForValuesAffectingDirection { return [NSSet setWithObject:@"camera"]; } @@ -3217,12 +3207,12 @@ public: [self setDirection:direction animated:NO]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingPitch ++ (NSSet<NSString *> *)keyPathsForValuesAffectingPitch { return [NSSet setWithObject:@"camera"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingCamera ++ (NSSet<NSString *> *)keyPathsForValuesAffectingCamera { return [NSSet setWithObjects:@"longitude", @"latitude", @"centerCoordinate", @"zoomLevel", @"direction", nil]; } @@ -3496,7 +3486,7 @@ public: #pragma mark - Annotations - -- (nullable NS_ARRAY_OF(id <MGLAnnotation>) *)annotations +- (nullable NSArray<id <MGLAnnotation>> *)annotations { if (_annotationContextsByAnnotationTag.empty()) { @@ -3520,12 +3510,12 @@ public: return [NSArray arrayWithObjects:&annotations[0] count:annotations.size()]; } -- (nullable NS_ARRAY_OF(id <MGLAnnotation>) *)visibleAnnotations +- (nullable NSArray<id <MGLAnnotation>> *)visibleAnnotations { return [self visibleAnnotationsInRect:self.bounds]; } -- (nullable NS_ARRAY_OF(id <MGLAnnotation>) *)visibleAnnotationsInRect:(CGRect)rect +- (nullable NSArray<id <MGLAnnotation>> *)visibleAnnotationsInRect:(CGRect)rect { if (_annotationContextsByAnnotationTag.empty()) { @@ -3599,7 +3589,7 @@ public: [self addAnnotations:@[ annotation ]]; } -- (void)addAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations +- (void)addAnnotations:(NSArray<id <MGLAnnotation>> *)annotations { if ( ! annotations) return; [self willChangeValueForKey:@"annotations"]; @@ -3740,7 +3730,7 @@ public: UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil); } -- (void)updateAnnotationContainerViewWithAnnotationViews:(NS_ARRAY_OF(MGLAnnotationView *) *)annotationViews +- (void)updateAnnotationContainerViewWithAnnotationViews:(NSArray<MGLAnnotationView *> *)annotationViews { if (annotationViews.count == 0) return; @@ -3895,7 +3885,7 @@ public: [self removeAnnotations:@[ annotation ]]; } -- (void)removeAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations +- (void)removeAnnotations:(NSArray<id <MGLAnnotation>> *)annotations { if ( ! annotations) return; @@ -3956,11 +3946,11 @@ public: } } -- (nonnull NS_ARRAY_OF(id <MGLOverlay>) *)overlays +- (nonnull NSArray<id <MGLOverlay>> *)overlays { if (self.annotations == nil) { return @[]; } - NS_MUTABLE_ARRAY_OF(id <MGLOverlay>) *mutableOverlays = [NSMutableArray array]; + NSMutableArray<id <MGLOverlay>> *mutableOverlays = [NSMutableArray array]; [self.annotations enumerateObjectsUsingBlock:^(id<MGLAnnotation> _Nonnull annotation, NSUInteger idx, BOOL * _Nonnull stop) { if ([annotation conformsToProtocol:@protocol(MGLOverlay)]) @@ -3977,7 +3967,7 @@ public: [self addOverlays:@[ overlay ]]; } -- (void)addOverlays:(NS_ARRAY_OF(id <MGLOverlay>) *)overlays +- (void)addOverlays:(NSArray<id <MGLOverlay>> *)overlays { #if DEBUG for (id <MGLOverlay> overlay in overlays) @@ -3994,7 +3984,7 @@ public: [self removeOverlays:@[ overlay ]]; } -- (void)removeOverlays:(NS_ARRAY_OF(id <MGLOverlay>) *)overlays +- (void)removeOverlays:(NSArray<id <MGLOverlay>> *)overlays { #if DEBUG for (id <MGLOverlay> overlay in overlays) @@ -4226,13 +4216,13 @@ public: [self didChangeValueForKey:@"selectedAnnotations"]; } -- (NS_ARRAY_OF(id <MGLAnnotation>) *)selectedAnnotations +- (NSArray<id <MGLAnnotation>> *)selectedAnnotations { id <MGLAnnotation> selectedAnnotation = self.selectedAnnotation; return (selectedAnnotation ? @[ selectedAnnotation ] : @[]); } -- (void)setSelectedAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)selectedAnnotations +- (void)setSelectedAnnotations:(NSArray<id <MGLAnnotation>> *)selectedAnnotations { if ( ! selectedAnnotations.count) return; @@ -4599,7 +4589,7 @@ public: completion:NULL]; } -- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations animated:(BOOL)animated +- (void)showAnnotations:(NSArray<id <MGLAnnotation>> *)annotations animated:(BOOL)animated { CGFloat maximumPadding = 100; CGFloat yPadding = (self.frame.size.height / 5 <= maximumPadding) ? (self.frame.size.height / 5) : maximumPadding; @@ -4610,7 +4600,7 @@ public: [self showAnnotations:annotations edgePadding:edgeInsets animated:animated]; } -- (void)showAnnotations:(NS_ARRAY_OF(id <MGLAnnotation>) *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated +- (void)showAnnotations:(NSArray<id <MGLAnnotation>> *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated { if ( ! annotations || ! annotations.count) return; @@ -4798,7 +4788,7 @@ public: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingUserLocation ++ (NSSet<NSString *> *)keyPathsForValuesAffectingUserLocation { return [NSSet setWithObject:@"userLocationAnnotationView"]; } @@ -5289,16 +5279,16 @@ public: #pragma mark Data -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesAtPoint:(CGPoint)point +- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point { return [self visibleFeaturesAtPoint:point inStyleLayersWithIdentifiers:nil]; } -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers { +- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NSSet<NSString *> *)styleLayerIdentifiers { return [self visibleFeaturesAtPoint:point inStyleLayersWithIdentifiers:styleLayerIdentifiers predicate:nil]; } -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(NSPredicate *)predicate +- (NSArray<id <MGLFeature>> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(NSSet<NSString *> *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { mbgl::ScreenCoordinate screenCoordinate = { point.x, point.y }; @@ -5323,15 +5313,15 @@ public: return MGLFeaturesFromMBGLFeatures(features); } -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesInRect:(CGRect)rect { +- (NSArray<id <MGLFeature>> *)visibleFeaturesInRect:(CGRect)rect { return [self visibleFeaturesInRect:rect inStyleLayersWithIdentifiers:nil]; } -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers { +- (NSArray<id <MGLFeature>> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NSSet<NSString *> *)styleLayerIdentifiers { return [self visibleFeaturesInRect:rect inStyleLayersWithIdentifiers:styleLayerIdentifiers predicate:nil]; } -- (NS_ARRAY_OF(id <MGLFeature>) *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NS_SET_OF(NSString *) *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { +- (NSArray<id <MGLFeature>> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(NSSet<NSString *> *)styleLayerIdentifiers predicate:(NSPredicate *)predicate { mbgl::ScreenBox screenBox = { { CGRectGetMinX(rect), CGRectGetMinY(rect) }, { CGRectGetMaxX(rect), CGRectGetMaxY(rect) }, @@ -6065,7 +6055,7 @@ public: views:views]]; } -- (NS_MUTABLE_ARRAY_OF(MGLAnnotationView *) *)annotationViewReuseQueueForIdentifier:(NSString *)identifier { +- (NSMutableArray<MGLAnnotationView *> *)annotationViewReuseQueueForIdentifier:(NSString *)identifier { if (!_annotationViewReuseQueueByIdentifier[identifier]) { _annotationViewReuseQueueByIdentifier[identifier] = [NSMutableArray array]; @@ -6222,7 +6212,7 @@ private: @implementation MGLMapView (IBAdditions) -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingStyleURL__ ++ (NSSet<NSString *> *)keyPathsForValuesAffectingStyleURL__ { return [NSSet setWithObject:@"styleURL"]; } @@ -6245,7 +6235,7 @@ private: self.styleURL = url; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingLatitude ++ (NSSet<NSString *> *)keyPathsForValuesAffectingLatitude { return [NSSet setWithObjects:@"centerCoordinate", @"camera", nil]; } @@ -6271,7 +6261,7 @@ private: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingLongitude ++ (NSSet<NSString *> *)keyPathsForValuesAffectingLongitude { return [NSSet setWithObjects:@"centerCoordinate", @"camera", nil]; } @@ -6297,7 +6287,7 @@ private: } } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsZooming ++ (NSSet<NSString *> *)keyPathsForValuesAffectingAllowsZooming { return [NSSet setWithObject:@"zoomEnabled"]; } @@ -6312,7 +6302,7 @@ private: self.zoomEnabled = allowsZooming; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsScrolling ++ (NSSet<NSString *> *)keyPathsForValuesAffectingAllowsScrolling { return [NSSet setWithObject:@"scrollEnabled"]; } @@ -6327,7 +6317,7 @@ private: self.scrollEnabled = allowsScrolling; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsRotating ++ (NSSet<NSString *> *)keyPathsForValuesAffectingAllowsRotating { return [NSSet setWithObject:@"rotateEnabled"]; } @@ -6342,7 +6332,7 @@ private: self.rotateEnabled = allowsRotating; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingAllowsTilting ++ (NSSet<NSString *> *)keyPathsForValuesAffectingAllowsTilting { return [NSSet setWithObject:@"pitchEnabled"]; } @@ -6357,7 +6347,7 @@ private: self.pitchEnabled = allowsTilting; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingShowsHeading ++ (NSSet<NSString *> *)keyPathsForValuesAffectingShowsHeading { return [NSSet setWithObject:@"showsUserHeadingIndicator"]; } diff --git a/platform/ios/src/MGLMapViewDelegate.h b/platform/ios/src/MGLMapViewDelegate.h index 0368d8413c..201e3db84b 100644 --- a/platform/ios/src/MGLMapViewDelegate.h +++ b/platform/ios/src/MGLMapViewDelegate.h @@ -428,7 +428,7 @@ NS_ASSUME_NONNULL_BEGIN @param annotationViews An array of `MGLAnnotationView` objects representing the views that were added. */ -- (void)mapView:(MGLMapView *)mapView didAddAnnotationViews:(NS_ARRAY_OF(MGLAnnotationView *) *)annotationViews; +- (void)mapView:(MGLMapView *)mapView didAddAnnotationViews:(NSArray<MGLAnnotationView *> *)annotationViews; #pragma mark Selecting Annotations diff --git a/platform/ios/src/MGLScaleBar.mm b/platform/ios/src/MGLScaleBar.mm index 139dffdfab..a2fc24c75c 100644 --- a/platform/ios/src/MGLScaleBar.mm +++ b/platform/ios/src/MGLScaleBar.mm @@ -178,12 +178,7 @@ static const CGFloat MGLFeetPerMeter = 3.28084; #pragma mark - Convenience methods - (BOOL)usesRightToLeftLayout { - // semanticContentAttribute is iOS 9+ - if ([self.superview respondsToSelector:@selector(semanticContentAttribute)]) { - return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.superview.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft; - } else { - return UIApplication.sharedApplication.userInterfaceLayoutDirection == UIUserInterfaceLayoutDirectionRightToLeft; - } + return [UIView userInterfaceLayoutDirectionForSemanticContentAttribute:self.superview.semanticContentAttribute] == UIUserInterfaceLayoutDirectionRightToLeft; } - (BOOL)usesMetricSystem { diff --git a/platform/ios/src/MGLUserLocation.m b/platform/ios/src/MGLUserLocation.m index 074d138a72..245cbf4371 100644 --- a/platform/ios/src/MGLUserLocation.m +++ b/platform/ios/src/MGLUserLocation.m @@ -68,7 +68,7 @@ NS_ASSUME_NONNULL_END return ! [key isEqualToString:@"location"] && ! [key isEqualToString:@"heading"]; } -+ (NS_SET_OF(NSString *) *)keyPathsForValuesAffectingCoordinate ++ (NSSet<NSString *> *)keyPathsForValuesAffectingCoordinate { return [NSSet setWithObject:@"location"]; } |