From c61194f5232d623e0a3b1029308d7c95d6f9eded Mon Sep 17 00:00:00 2001 From: Bart Louwers Date: Sat, 28 Jan 2023 13:27:49 +0100 Subject: [PATCH] Replace `#pragma - mark` with comments (#736) Co-authored-by: Ovidiu Voda --- platform/darwin/src/native_apple_interface.m | 2 +- platform/darwin/src/reachability.m | 12 +++--- .../ios/platform/darwin/src/MGLAnnotation.h | 4 +- .../darwin/src/MGLBackgroundStyleLayer.h | 2 +- .../darwin/src/MGLBackgroundStyleLayer.mm | 2 +- .../platform/darwin/src/MGLCircleStyleLayer.h | 6 +-- .../darwin/src/MGLCircleStyleLayer.mm | 4 +- .../darwin/src/MGLFillExtrusionStyleLayer.h | 4 +- .../darwin/src/MGLFillExtrusionStyleLayer.mm | 2 +- .../platform/darwin/src/MGLFillStyleLayer.h | 6 +-- .../platform/darwin/src/MGLFillStyleLayer.mm | 4 +- .../darwin/src/MGLForegroundStyleLayer.h | 4 +- .../darwin/src/MGLHeatmapStyleLayer.h | 2 +- .../darwin/src/MGLHeatmapStyleLayer.mm | 2 +- .../darwin/src/MGLHillshadeStyleLayer.h | 4 +- .../darwin/src/MGLHillshadeStyleLayer.mm | 2 +- .../ios/platform/darwin/src/MGLImageSource.h | 4 +- .../platform/darwin/src/MGLLineStyleLayer.h | 6 +-- .../platform/darwin/src/MGLLineStyleLayer.mm | 4 +- .../platform/darwin/src/MGLLocationManager.h | 14 +++---- .../platform/darwin/src/MGLLocationManager.m | 2 +- .../platform/darwin/src/MGLMapSnapshotter.h | 4 +- .../darwin/src/MGLNetworkConfiguration.mm | 6 +-- .../platform/darwin/src/MGLOfflineStorage.h | 8 ++-- .../platform/darwin/src/MGLOfflineStorage.mm | 8 ++-- .../darwin/src/MGLOpenGLStyleLayer.mm | 2 +- .../platform/darwin/src/MGLRasterStyleLayer.h | 4 +- .../darwin/src/MGLRasterStyleLayer.mm | 2 +- .../platform/darwin/src/MGLRasterTileSource.h | 2 +- .../ios/platform/darwin/src/MGLReachability.m | 12 +++--- .../ios/platform/darwin/src/MGLSettings.h | 4 +- .../ios/platform/darwin/src/MGLSettings.mm | 2 +- platform/ios/platform/darwin/src/MGLShape.h | 6 +-- .../ios/platform/darwin/src/MGLShapeSource.h | 4 +- .../ios/platform/darwin/src/MGLShapeSource.mm | 2 +- platform/ios/platform/darwin/src/MGLSource.h | 4 +- platform/ios/platform/darwin/src/MGLStyle.h | 14 +++---- platform/ios/platform/darwin/src/MGLStyle.mm | 16 ++++---- .../ios/platform/darwin/src/MGLStyleLayer.h | 6 +-- .../platform/darwin/src/MGLStyleLayer.h.ejs | 6 +-- .../platform/darwin/src/MGLStyleLayer.mm.ejs | 4 +- .../platform/darwin/src/MGLSymbolStyleLayer.h | 6 +-- .../darwin/src/MGLSymbolStyleLayer.mm | 4 +- .../ios/platform/darwin/src/MGLTileSource.h | 4 +- .../platform/darwin/src/MGLVectorStyleLayer.h | 2 +- .../platform/darwin/src/MGLVectorTileSource.h | 4 +- .../darwin/src/NSExpression+MGLAdditions.h | 12 +++--- .../darwin/src/NSExpression+MGLAdditions.mm | 2 +- .../darwin/src/NSPredicate+MGLAdditions.h | 2 +- .../darwin/src/NSValue+MGLAdditions.h | 6 +-- .../darwin/src/NSValue+MGLAdditions.m | 6 +-- .../darwin/test/MGLExpressionTests.mm | 14 +++---- .../darwin/test/MGLMapSnapshotterTests.m | 4 +- .../ios/platform/darwin/test/MGLStyleTests.mm | 4 +- .../MGLAnnotationViewIntegrationTests.mm | 8 ++-- .../MGLCameraTransitionFinishTests.mm | 2 +- .../Camera Tests/MGLCameraTransitionTests.mm | 2 +- .../Integration Tests/MBGLIntegrationTests.mm | 2 +- .../MGLMapViewIntegrationTest.m | 4 +- .../MGLMapViewPendingBlockTests.m | 4 +- ...MGLNetworkConfigurationIntegrationTests.mm | 6 +-- .../ios/platform/ios/app/MBXAppDelegate.m | 2 +- .../platform/ios/app/MBXCustomCalloutView.m | 4 +- .../ios/app/MBXCustomLocationViewController.m | 2 +- .../ios/app/MBXEmbeddedMapViewController.m | 4 +- .../app/MBXOfflinePacksTableViewController.m | 6 +-- .../ios/platform/ios/app/MBXViewController.m | 16 ++++---- .../ios/app/MGLMapView_Experimental.h | 2 +- .../ios/benchmark/MBXBenchViewController.mm | 2 +- .../ios/src/MGLAnnotationContainerView.m | 2 +- .../ios/platform/ios/src/MGLAnnotationImage.h | 4 +- .../ios/platform/ios/src/MGLAnnotationView.h | 8 ++-- .../ios/platform/ios/src/MGLAnnotationView.mm | 4 +- platform/ios/platform/ios/src/MGLMapView.h | 24 +++++------ platform/ios/platform/ios/src/MGLMapView.mm | 40 +++++++++---------- .../ios/platform/ios/src/MGLMapViewDelegate.h | 14 +++---- platform/ios/platform/ios/src/MGLScaleBar.mm | 14 +++---- .../ios/platform/ios/src/MGLUserLocation.h | 4 +- .../ios/test/MGLAnnotationViewTests.m | 2 +- platform/ios/platform/macos/app/AppDelegate.m | 12 +++--- platform/ios/platform/macos/app/MapDocument.m | 30 +++++++------- .../platform/macos/src/MGLAnnotationImage.h | 4 +- platform/ios/platform/macos/src/MGLMapView.h | 24 +++++------ platform/ios/platform/macos/src/MGLMapView.mm | 38 +++++++++--------- .../platform/macos/src/MGLMapViewDelegate.h | 10 ++--- src/mbgl/map/map.cpp | 20 +++++----- src/mbgl/map/map_impl.cpp | 4 +- src/mbgl/map/transform.cpp | 26 ++++++------ src/mbgl/map/transform_state.cpp | 32 +++++++-------- 89 files changed, 330 insertions(+), 330 deletions(-) diff --git a/platform/darwin/src/native_apple_interface.m b/platform/darwin/src/native_apple_interface.m index 2262251e2..361ee181b 100644 --- a/platform/darwin/src/native_apple_interface.m +++ b/platform/darwin/src/native_apple_interface.m @@ -24,7 +24,7 @@ static MGLNativeNetworkManager *instance = nil; return sessionConfiguration; } -#pragma mark - Required +// MARK: - Required - (NSURLSessionConfiguration *)sessionConfiguration { NSURLSessionConfiguration *configuration = [_delegate sessionConfiguration]; diff --git a/platform/darwin/src/reachability.m b/platform/darwin/src/reachability.m index 737145a8a..4f7b83e62 100644 --- a/platform/darwin/src/reachability.m +++ b/platform/darwin/src/reachability.m @@ -86,7 +86,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea @implementation MGLReachability -#pragma mark - Class Constructor Methods +// MARK: - Class Constructor Methods +(instancetype)reachabilityWithHostName:(NSString*)hostname { @@ -180,7 +180,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea _reachabilitySerialQueue = nil; } -#pragma mark - Notifier Methods +// MARK: - Notifier Methods // Notifier // NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD @@ -242,7 +242,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea self.reachabilityObject = nil; } -#pragma mark - reachability tests +// MARK: - reachability tests // This is for the case where you flick the airplane mode; // you end up getting something like this: @@ -384,7 +384,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea } -#pragma mark - reachability status stuff +// MARK: - reachability status stuff -(NetworkStatus)currentReachabilityStatus { @@ -435,7 +435,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return reachabilityFlags([self reachabilityFlags]); } -#pragma mark - Callback function calls this method +// MARK: - Callback function calls this method -(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags { @@ -461,7 +461,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea }); } -#pragma mark - Debug Description +// MARK: - Debug Description - (NSString *) description { diff --git a/platform/ios/platform/darwin/src/MGLAnnotation.h b/platform/ios/platform/darwin/src/MGLAnnotation.h index a8ac1e7e5..b170eeb51 100644 --- a/platform/ios/platform/darwin/src/MGLAnnotation.h +++ b/platform/ios/platform/darwin/src/MGLAnnotation.h @@ -25,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN */ @protocol MGLAnnotation -#pragma mark Position Attributes +// MARK: Position Attributes /** The center point (specified as a map coordinate) of the annotation. (required) @@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN @optional -#pragma mark Title Attributes +// MARK: Title Attributes /** The string containing the annotation’s title. diff --git a/platform/ios/platform/darwin/src/MGLBackgroundStyleLayer.h b/platform/ios/platform/darwin/src/MGLBackgroundStyleLayer.h index 31755c8ba..74fb455be 100644 --- a/platform/ios/platform/darwin/src/MGLBackgroundStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLBackgroundStyleLayer.h @@ -35,7 +35,7 @@ which it is added. */ - (instancetype)initWithIdentifier:(NSString *)identifier; -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes #if TARGET_OS_IPHONE /** diff --git a/platform/ios/platform/darwin/src/MGLBackgroundStyleLayer.mm b/platform/ios/platform/darwin/src/MGLBackgroundStyleLayer.mm index 053e05c5c..ad8fd0a78 100644 --- a/platform/ios/platform/darwin/src/MGLBackgroundStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLBackgroundStyleLayer.mm @@ -34,7 +34,7 @@ return (mbgl::style::BackgroundLayer *)super.rawLayer; } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setBackgroundColor:(NSExpression *)backgroundColor { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLCircleStyleLayer.h b/platform/ios/platform/darwin/src/MGLCircleStyleLayer.h index 9ff014f8b..0e9c69f65 100644 --- a/platform/ios/platform/darwin/src/MGLCircleStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLCircleStyleLayer.h @@ -125,7 +125,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes /** Sorts features in ascending order based on this value. Features with a higher @@ -142,7 +142,7 @@ MGL_EXPORT */ @property (nonatomic, null_resettable) NSExpression *circleSortKey; -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes /** Amount to blur the circle. 1 blurs the circle such that only the centerpoint is @@ -516,7 +516,7 @@ MGL_EXPORT */ @interface NSValue (MGLCircleStyleLayerAdditions) -#pragma mark Working with Circle Style Layer Attribute Values +// MARK: Working with Circle Style Layer Attribute Values /** Creates a new value object containing the given `MGLCirclePitchAlignment` enumeration. diff --git a/platform/ios/platform/darwin/src/MGLCircleStyleLayer.mm b/platform/ios/platform/darwin/src/MGLCircleStyleLayer.mm index bccd7e29f..cd9a03f5a 100644 --- a/platform/ios/platform/darwin/src/MGLCircleStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLCircleStyleLayer.mm @@ -91,7 +91,7 @@ namespace mbgl { return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()]; } -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes - (void)setCircleSortKey:(NSExpression *)circleSortKey { MGLAssertStyleLayerIsValid(); @@ -111,7 +111,7 @@ namespace mbgl { return MGLStyleValueTransformer().toExpression(propertyValue); } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setCircleBlur:(NSExpression *)circleBlur { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.h b/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.h index adb215c41..c1dac0222 100644 --- a/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.h @@ -73,7 +73,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes /** The height with which to extrude the base of this layer. Must be less than or @@ -368,7 +368,7 @@ MGL_EXPORT */ @interface NSValue (MGLFillExtrusionStyleLayerAdditions) -#pragma mark Working with Fill extrusion Style Layer Attribute Values +// MARK: Working with Fill extrusion Style Layer Attribute Values /** Creates a new value object containing the given `MGLFillExtrusionTranslationAnchor` enumeration. diff --git a/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.mm b/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.mm index ed6cd5846..1115f223e 100644 --- a/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLFillExtrusionStyleLayer.mm @@ -81,7 +81,7 @@ namespace mbgl { return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()]; } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setFillExtrusionBase:(NSExpression *)fillExtrusionBase { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLFillStyleLayer.h b/platform/ios/platform/darwin/src/MGLFillStyleLayer.h index 931a0abdd..0acc1a518 100644 --- a/platform/ios/platform/darwin/src/MGLFillStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLFillStyleLayer.h @@ -76,7 +76,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes /** Sorts features in ascending order based on this value. Features with a higher @@ -93,7 +93,7 @@ MGL_EXPORT */ @property (nonatomic, null_resettable) NSExpression *fillSortKey; -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes /** Whether or not the fill should be antialiased. @@ -368,7 +368,7 @@ MGL_EXPORT */ @interface NSValue (MGLFillStyleLayerAdditions) -#pragma mark Working with Fill Style Layer Attribute Values +// MARK: Working with Fill Style Layer Attribute Values /** Creates a new value object containing the given `MGLFillTranslationAnchor` enumeration. diff --git a/platform/ios/platform/darwin/src/MGLFillStyleLayer.mm b/platform/ios/platform/darwin/src/MGLFillStyleLayer.mm index a26a16c4d..5c1a9e73d 100644 --- a/platform/ios/platform/darwin/src/MGLFillStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLFillStyleLayer.mm @@ -81,7 +81,7 @@ namespace mbgl { return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()]; } -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes - (void)setFillSortKey:(NSExpression *)fillSortKey { MGLAssertStyleLayerIsValid(); @@ -101,7 +101,7 @@ namespace mbgl { return MGLStyleValueTransformer().toExpression(propertyValue); } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setFillAntialiased:(NSExpression *)fillAntialiased { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLForegroundStyleLayer.h b/platform/ios/platform/darwin/src/MGLForegroundStyleLayer.h index 7e05023ef..8720bf59c 100644 --- a/platform/ios/platform/darwin/src/MGLForegroundStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLForegroundStyleLayer.h @@ -20,11 +20,11 @@ NS_ASSUME_NONNULL_BEGIN MGL_EXPORT @interface MGLForegroundStyleLayer : MGLStyleLayer -#pragma mark Initializing a Style Layer +// MARK: Initializing a Style Layer - (instancetype)init __attribute__((unavailable("Use -init methods of concrete subclasses instead."))); -#pragma mark Specifying a Style Layer’s Content +// MARK: Specifying a Style Layer’s Content /** Identifier of the source from which the receiver obtains the data to style. diff --git a/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.h b/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.h index dc35cd413..5996bd1df 100644 --- a/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.h @@ -75,7 +75,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes #if TARGET_OS_IPHONE /** diff --git a/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.mm b/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.mm index 41d9597dd..54a065450 100644 --- a/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLHeatmapStyleLayer.mm @@ -72,7 +72,7 @@ return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()]; } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setHeatmapColor:(NSExpression *)heatmapColor { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.h b/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.h index 1cf379732..5fa2449d1 100644 --- a/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.h @@ -73,7 +73,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes #if TARGET_OS_IPHONE /** @@ -304,7 +304,7 @@ MGL_EXPORT */ @interface NSValue (MGLHillshadeStyleLayerAdditions) -#pragma mark Working with Hillshade Style Layer Attribute Values +// MARK: Working with Hillshade Style Layer Attribute Values /** Creates a new value object containing the given `MGLHillshadeIlluminationAnchor` enumeration. diff --git a/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.mm b/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.mm index 6bb167d43..bb747f3af 100644 --- a/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLHillshadeStyleLayer.mm @@ -50,7 +50,7 @@ namespace mbgl { return @(self.rawLayer->getSourceID().c_str()); } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setHillshadeAccentColor:(NSExpression *)hillshadeAccentColor { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLImageSource.h b/platform/ios/platform/darwin/src/MGLImageSource.h index 3a3ca53e9..628ca06d5 100644 --- a/platform/ios/platform/darwin/src/MGLImageSource.h +++ b/platform/ios/platform/darwin/src/MGLImageSource.h @@ -50,7 +50,7 @@ MGL_EXPORT MGL_EXPORT @interface MGLImageSource : MGLSource -#pragma mark Initializing a Source +// MARK: Initializing a Source /** Returns a georeferenced image source with an identifier, coordinates and a URL. @@ -73,7 +73,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier coordinateQuad:(MGLCoordinateQuad)coordinateQuad image:(MGLImage *)image; -#pragma mark Accessing a Source’s Content +// MARK: Accessing a Source’s Content /** The URL to the source image. diff --git a/platform/ios/platform/darwin/src/MGLLineStyleLayer.h b/platform/ios/platform/darwin/src/MGLLineStyleLayer.h index 624b5f3c9..8b0e0d667 100644 --- a/platform/ios/platform/darwin/src/MGLLineStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLLineStyleLayer.h @@ -135,7 +135,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes /** The display of line endings. @@ -249,7 +249,7 @@ MGL_EXPORT */ @property (nonatomic, null_resettable) NSExpression *lineSortKey; -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes /** Blur applied to the line, in points. @@ -645,7 +645,7 @@ MGL_EXPORT */ @interface NSValue (MGLLineStyleLayerAdditions) -#pragma mark Working with Line Style Layer Attribute Values +// MARK: Working with Line Style Layer Attribute Values /** Creates a new value object containing the given `MGLLineCap` enumeration. diff --git a/platform/ios/platform/darwin/src/MGLLineStyleLayer.mm b/platform/ios/platform/darwin/src/MGLLineStyleLayer.mm index 33504ba09..1e9aebd50 100644 --- a/platform/ios/platform/darwin/src/MGLLineStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLLineStyleLayer.mm @@ -93,7 +93,7 @@ namespace mbgl { return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()]; } -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes - (void)setLineCap:(NSExpression *)lineCap { MGLAssertStyleLayerIsValid(); @@ -185,7 +185,7 @@ namespace mbgl { return MGLStyleValueTransformer().toExpression(propertyValue); } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setLineBlur:(NSExpression *)lineBlur { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLLocationManager.h b/platform/ios/platform/darwin/src/MGLLocationManager.h index d9dfe3911..8d0c058a1 100644 --- a/platform/ios/platform/darwin/src/MGLLocationManager.h +++ b/platform/ios/platform/darwin/src/MGLLocationManager.h @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN @optional -#pragma mark Configuring Location Update Precision +// MARK: Configuring Location Update Precision /** Specifies the minimum distance (measured in meters) a device must move horizontally @@ -111,7 +111,7 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, weak) id delegate; -#pragma mark Requesting Authorization for Location Services +// MARK: Requesting Authorization for Location Services /** Returns the current localization authorization status. @@ -131,7 +131,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)requestWhenInUseAuthorization; -#pragma mark Initiating Location Updates +// MARK: Initiating Location Updates /** Starts the generation of location updates that reports the user's current location. @@ -143,7 +143,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)stopUpdatingLocation; -#pragma mark Initiating Heading Updates +// MARK: Initiating Heading Updates /** Specifies a physical device orientation. @@ -174,7 +174,7 @@ NS_ASSUME_NONNULL_BEGIN */ @protocol MGLLocationManagerDelegate -#pragma mark Responding to Location Updates +// MARK: Responding to Location Updates /** Notifies the delegate with the new location data. @@ -188,7 +188,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)locationManager:(id)manager didUpdateLocations:(NSArray *)locations; -#pragma mark Responding to Heading Updates +// MARK: Responding to Heading Updates /** Notifies the delegate with the new heading data. @@ -206,7 +206,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)locationManagerShouldDisplayHeadingCalibration:(id)manager; -#pragma mark Responding to Location Updates Errors +// MARK: Responding to Location Updates Errors /** Notifies the delegate that the location manager was unable to retrieve diff --git a/platform/ios/platform/darwin/src/MGLLocationManager.m b/platform/ios/platform/darwin/src/MGLLocationManager.m index 5729f26b3..7027d7c58 100644 --- a/platform/ios/platform/darwin/src/MGLLocationManager.m +++ b/platform/ios/platform/darwin/src/MGLLocationManager.m @@ -110,7 +110,7 @@ self.delegate = nil; } -#pragma mark - CLLocationManagerDelegate +// MARK: - CLLocationManagerDelegate - (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations { if ([self.delegate respondsToSelector:@selector(locationManager:didUpdateLocations:)]) { diff --git a/platform/ios/platform/darwin/src/MGLMapSnapshotter.h b/platform/ios/platform/darwin/src/MGLMapSnapshotter.h index 6fb0b52bd..13c83fe99 100644 --- a/platform/ios/platform/darwin/src/MGLMapSnapshotter.h +++ b/platform/ios/platform/darwin/src/MGLMapSnapshotter.h @@ -73,7 +73,7 @@ MGL_EXPORT */ - (instancetype)initWithStyleURL:(nullable NSURL *)styleURL camera:(MGLMapCamera *)camera size:(CGSize)size; -#pragma mark - Configuring the Map +// MARK: - Configuring the Map /** URL of the map style to snapshot. @@ -106,7 +106,7 @@ MGL_EXPORT */ @property (nonatomic) MGLCoordinateBounds coordinateBounds; -#pragma mark - Configuring the Image +// MARK: - Configuring the Image /** The size of the output image, measured in points. diff --git a/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm b/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm index ac4a23855..97b0d4aa0 100644 --- a/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm +++ b/platform/ios/platform/darwin/src/MGLNetworkConfiguration.mm @@ -64,7 +64,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; return sessionConfiguration; } -#pragma mark - MGLNativeNetworkDelegate +// MARK: - MGLNativeNetworkDelegate - (NSURLSession *)sessionForNetworkManager:(MGLNativeNetworkManager *)networkManager { // Note: this method is NOT called on the main thread. @@ -129,7 +129,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; MGLLogError(message); } -#pragma mark - Event management +// MARK: - Event management - (void)sendEventForURLResponse:(NSURLResponse *)response withAction:(NSString *)action { @@ -184,7 +184,7 @@ NSString * const kMGLDownloadPerformanceEvent = @"mobile.performance_trace"; }; } -#pragma mark - Events dictionary access +// MARK: - Events dictionary access - (nullable NSDictionary*)eventDictionaryForKey:(nonnull NSString*)key { __block NSDictionary *dictionary; diff --git a/platform/ios/platform/darwin/src/MGLOfflineStorage.h b/platform/ios/platform/darwin/src/MGLOfflineStorage.h index e6e8f6388..503ac6f46 100644 --- a/platform/ios/platform/darwin/src/MGLOfflineStorage.h +++ b/platform/ios/platform/darwin/src/MGLOfflineStorage.h @@ -201,7 +201,7 @@ MGL_EXPORT */ @property (class, nonatomic, readonly) MGLOfflineStorage *sharedOfflineStorage; -#pragma mark - Accessing the Delegate +// MARK: - Accessing the Delegate /** The receiver’s delegate. @@ -213,7 +213,7 @@ MGL_EXPORT */ @property(nonatomic, weak, nullable) IBOutlet id delegate; -#pragma mark - Managing the Database of Offline Packs +// MARK: - Managing the Database of Offline Packs /** The file path at which offline packs and the ambient cache are stored. @@ -267,7 +267,7 @@ MGL_EXPORT */ - (void)addContentsOfURL:(NSURL *)fileURL withCompletionHandler:(nullable MGLBatchedOfflinePackAdditionCompletionHandler)completion; -#pragma mark - Managing Offline Packs +// MARK: - Managing Offline Packs /** An array of all known offline packs, in the order in which they were created. @@ -385,7 +385,7 @@ MGL_EXPORT */ @property (nonatomic, readonly) unsigned long long countOfBytesCompleted; -#pragma mark - Managing the Ambient Cache +// MARK: - Managing the Ambient Cache /** Sets the maximum ambient cache size in bytes. The default maximum cache diff --git a/platform/ios/platform/darwin/src/MGLOfflineStorage.mm b/platform/ios/platform/darwin/src/MGLOfflineStorage.mm index 77477a8b6..d3eac1a95 100644 --- a/platform/ios/platform/darwin/src/MGLOfflineStorage.mm +++ b/platform/ios/platform/darwin/src/MGLOfflineStorage.mm @@ -214,7 +214,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } } -#pragma mark Database management methods +// MARK: Database management methods - (NSString *)databasePath { return self.databaseURL.path; @@ -404,7 +404,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio }); } -#pragma mark Pack management methods +// MARK: Pack management methods - (void)addPackForRegion:(id )region withContext:(NSData *)context completionHandler:(MGLOfflinePackAdditionCompletionHandler)completion { MGLLogDebug(@"Adding packForRegion: %@ contextLength: %lu completionHandler: %@", region, (unsigned long)context.length, completion); @@ -544,7 +544,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio _mbglDatabaseFileSource->setOfflineMapboxTileCountLimit(maximumCount); } -#pragma mark - Ambient cache management +// MARK: - Ambient cache management - (void)setMaximumAmbientCacheSize:(NSUInteger)cacheSize withCompletionHandler:(void (^)(NSError * _Nullable))completion { _mbglDatabaseFileSource->setMaximumAmbientCacheSize(cacheSize, [&, completion](std::exception_ptr exception) { @@ -610,7 +610,7 @@ const MGLExceptionName MGLUnsupportedRegionTypeException = @"MGLUnsupportedRegio } }); } -#pragma mark - +// MARK: - - (unsigned long long)countOfBytesCompleted { NSDictionary *attributes = [[NSFileManager defaultManager] attributesOfItemAtPath:self.databasePath error:NULL]; diff --git a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm index 8502a3ff6..7dd057556 100644 --- a/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLOpenGLStyleLayer.mm @@ -85,7 +85,7 @@ class MGLOpenGLLayerHost; } #endif -#pragma mark - Adding to and removing from a map view +// MARK: - Adding to and removing from a map view - (void)addToStyle:(MGLStyle *)style belowLayer:(MGLStyleLayer *)otherLayer { self.style = style; self.style.openGLLayers[self.identifier] = self; diff --git a/platform/ios/platform/darwin/src/MGLRasterStyleLayer.h b/platform/ios/platform/darwin/src/MGLRasterStyleLayer.h index 87cf5be1b..e4edff268 100644 --- a/platform/ios/platform/darwin/src/MGLRasterStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLRasterStyleLayer.h @@ -84,7 +84,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes /** Increase or reduce the brightness of the image. The value is the maximum @@ -327,7 +327,7 @@ MGL_EXPORT */ @interface NSValue (MGLRasterStyleLayerAdditions) -#pragma mark Working with Raster Style Layer Attribute Values +// MARK: Working with Raster Style Layer Attribute Values /** Creates a new value object containing the given `MGLRasterResamplingMode` enumeration. diff --git a/platform/ios/platform/darwin/src/MGLRasterStyleLayer.mm b/platform/ios/platform/darwin/src/MGLRasterStyleLayer.mm index 2198d441d..d4d6a4fda 100644 --- a/platform/ios/platform/darwin/src/MGLRasterStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLRasterStyleLayer.mm @@ -50,7 +50,7 @@ namespace mbgl { return @(self.rawLayer->getSourceID().c_str()); } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setMaximumRasterBrightness:(NSExpression *)maximumRasterBrightness { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLRasterTileSource.h b/platform/ios/platform/darwin/src/MGLRasterTileSource.h index 80d6b8e57..eb8eed0a8 100644 --- a/platform/ios/platform/darwin/src/MGLRasterTileSource.h +++ b/platform/ios/platform/darwin/src/MGLRasterTileSource.h @@ -61,7 +61,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLTileSourceOption MGLTileSourceOptionTileSi MGL_EXPORT @interface MGLRasterTileSource : MGLTileSource -#pragma mark Initializing a Source +// MARK: Initializing a Source /** Returns a raster tile source initialized with an identifier and configuration diff --git a/platform/ios/platform/darwin/src/MGLReachability.m b/platform/ios/platform/darwin/src/MGLReachability.m index a3c8a57aa..72396a2b0 100644 --- a/platform/ios/platform/darwin/src/MGLReachability.m +++ b/platform/ios/platform/darwin/src/MGLReachability.m @@ -86,7 +86,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea @implementation MGLReachability -#pragma mark - Class Constructor Methods +// MARK: - Class Constructor Methods +(instancetype)reachabilityWithHostName:(NSString*)hostname { @@ -180,7 +180,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea _reachabilitySerialQueue = nil; } -#pragma mark - Notifier Methods +// MARK: - Notifier Methods // Notifier // NOTE: This uses GCD to trigger the blocks - they *WILL NOT* be called on THE MAIN THREAD @@ -242,7 +242,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea self.reachabilityObject = nil; } -#pragma mark - reachability tests +// MARK: - reachability tests // This is for the case where you flick the airplane mode; // you end up getting something like this: @@ -384,7 +384,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea } -#pragma mark - reachability status stuff +// MARK: - reachability status stuff -(NetworkStatus)currentReachabilityStatus { @@ -435,7 +435,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea return reachabilityFlags([self reachabilityFlags]); } -#pragma mark - Callback function calls this method +// MARK: - Callback function calls this method -(void)reachabilityChanged:(SCNetworkReachabilityFlags)flags { @@ -461,7 +461,7 @@ static void TMReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkRea }); } -#pragma mark - Debug Description +// MARK: - Debug Description - (NSString *) description { diff --git a/platform/ios/platform/darwin/src/MGLSettings.h b/platform/ios/platform/darwin/src/MGLSettings.h index 34a8a1422..c2408ad40 100644 --- a/platform/ios/platform/darwin/src/MGLSettings.h +++ b/platform/ios/platform/darwin/src/MGLSettings.h @@ -30,14 +30,14 @@ typedef NS_ENUM(NSUInteger, MGLWellKnownTileServer) { MGL_EXPORT @interface MGLSettings : NSObject -#pragma mark Tile Server Configuration +// MARK: Tile Server Configuration /** Tile server options */ @property (class, copy, nullable) MGLTileServerOptions* tileServerOptions; -#pragma mark Authorizing Access +// MARK: Authorizing Access /** The API Key used by all instances of `MGLMapView` in the current application. diff --git a/platform/ios/platform/darwin/src/MGLSettings.mm b/platform/ios/platform/darwin/src/MGLSettings.mm index b20bb581b..a1a8273fc 100644 --- a/platform/ios/platform/darwin/src/MGLSettings.mm +++ b/platform/ios/platform/darwin/src/MGLSettings.mm @@ -15,7 +15,7 @@ @implementation MGLSettings -#pragma mark - Internal +// MARK: - Internal - (instancetype)init { if (self = [super init]) { diff --git a/platform/ios/platform/darwin/src/MGLShape.h b/platform/ios/platform/darwin/src/MGLShape.h index 317aefe37..46f0d1897 100644 --- a/platform/ios/platform/darwin/src/MGLShape.h +++ b/platform/ios/platform/darwin/src/MGLShape.h @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN MGL_EXPORT @interface MGLShape : NSObject -#pragma mark Creating a Shape +// MARK: Creating a Shape /** Returns an `MGLShape` object initialized with the given data interpreted as a @@ -69,7 +69,7 @@ MGL_EXPORT */ + (nullable MGLShape *)shapeWithData:(NSData *)data encoding:(NSStringEncoding)encoding error:(NSError * _Nullable *)outError; -#pragma mark Accessing the Shape Attributes +// MARK: Accessing the Shape Attributes /** The title of the shape annotation. @@ -105,7 +105,7 @@ MGL_EXPORT #endif -#pragma mark Creating GeoJSON Data +// MARK: Creating GeoJSON Data /** Returns the GeoJSON string representation of the shape encapsulated in a data diff --git a/platform/ios/platform/darwin/src/MGLShapeSource.h b/platform/ios/platform/darwin/src/MGLShapeSource.h index 5c08a1faf..439340d4e 100644 --- a/platform/ios/platform/darwin/src/MGLShapeSource.h +++ b/platform/ios/platform/darwin/src/MGLShapeSource.h @@ -186,7 +186,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLShapeSourceOption MGLShapeSourceOptionLine MGL_EXPORT @interface MGLShapeSource : MGLSource -#pragma mark Initializing a Source +// MARK: Initializing a Source /** Returns a shape source with an identifier, URL, and dictionary of options for @@ -302,7 +302,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier shapes:(NSArray *)shapes options:(nullable NSDictionary *)options; -#pragma mark Accessing a Source’s Content +// MARK: Accessing a Source’s Content /** The contents of the source. A shape can represent a GeoJSON geometry, a diff --git a/platform/ios/platform/darwin/src/MGLShapeSource.mm b/platform/ios/platform/darwin/src/MGLShapeSource.mm index 864b4c546..2f2b86c37 100644 --- a/platform/ios/platform/darwin/src/MGLShapeSource.mm +++ b/platform/ios/platform/darwin/src/MGLShapeSource.mm @@ -250,7 +250,7 @@ mbgl::Immutable MGLGeoJSONOptionsFromDictionary(NSD return MGLFeaturesFromMBGLFeatures(features); } -#pragma mark - MGLCluster management +// MARK: - MGLCluster management - (mbgl::optional)featureExtensionValueOfCluster:(MGLShape *)cluster extension:(std::string)extension options:(const std::map)options { MGLAssertStyleSourceIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLSource.h b/platform/ios/platform/darwin/src/MGLSource.h index dc92e652e..485ac9f06 100644 --- a/platform/ios/platform/darwin/src/MGLSource.h +++ b/platform/ios/platform/darwin/src/MGLSource.h @@ -28,7 +28,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidStyleSourceExcepti MGL_EXPORT @interface MGLSource : NSObject -#pragma mark Initializing a Source +// MARK: Initializing a Source - (instancetype)init __attribute__((unavailable("Use -initWithIdentifier: instead."))); @@ -44,7 +44,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier; -#pragma mark Identifying a Source +// MARK: Identifying a Source /** A string that uniquely identifies the source in the style to which it is added. diff --git a/platform/ios/platform/darwin/src/MGLStyle.h b/platform/ios/platform/darwin/src/MGLStyle.h index cd103ef02..ebe48ea4f 100644 --- a/platform/ios/platform/darwin/src/MGLStyle.h +++ b/platform/ios/platform/darwin/src/MGLStyle.h @@ -44,7 +44,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLRedundantSourceIdentifier MGL_EXPORT @interface MGLStyle : NSObject -#pragma mark Accessing Default Styles +// MARK: Accessing Default Styles /** Returns list of predefined styles @@ -67,7 +67,7 @@ MGL_EXPORT */ + (MGLDefaultStyle*) predefinedStyle:(NSString*)withStyleName; -#pragma mark Accessing Metadata About the Style +// MARK: Accessing Metadata About the Style /** The name of the style. @@ -76,7 +76,7 @@ MGL_EXPORT */ @property (readonly, copy, nullable) NSString *name; -#pragma mark Managing Sources +// MARK: Managing Sources /** A set containing the style’s sources. @@ -165,7 +165,7 @@ MGL_EXPORT - (BOOL)removeSource:(MGLSource *)source error:(NSError * __nullable * __nullable)outError; -#pragma mark Managing Style Layers +// MARK: Managing Style Layers /** The layers included in the style, arranged according to their back-to-front @@ -292,7 +292,7 @@ MGL_EXPORT */ - (void)removeLayer:(MGLStyleLayer *)layer; -#pragma mark Managing a Style’s Images +// MARK: Managing a Style’s Images /** Returns the image associated with the given name in the style. @@ -345,14 +345,14 @@ MGL_EXPORT - (void)removeImageForName:(NSString *)name; -#pragma mark Managing the Style's Light +// MARK: Managing the Style's Light /** Provides global light source for the style. */ @property (nonatomic, strong) MGLLight *light; -#pragma mark Localizing Map Content +// MARK: Localizing Map Content /** Attempts to localize labels in the style into the given locale. diff --git a/platform/ios/platform/darwin/src/MGLStyle.mm b/platform/ios/platform/darwin/src/MGLStyle.mm index 80e823693..f946bb1d4 100644 --- a/platform/ios/platform/darwin/src/MGLStyle.mm +++ b/platform/ios/platform/darwin/src/MGLStyle.mm @@ -86,7 +86,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou @implementation MGLStyle -#pragma mark Predefined style URLs +// MARK: Predefined style URLs + (NSArray*) predefinedStyles { return MGLSettings.tileServerOptions.defaultStyles; @@ -115,7 +115,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return nil; } -#pragma mark - +// MARK: - - (instancetype)initWithRawStyle:(mbgl::style::Style *)rawStyle stylable:(id )stylable { MGLLogInfo(@"Initializing %@ with stylable: %@", NSStringFromClass([self class]), stylable); @@ -138,7 +138,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return name.empty() ? nil : @(name.c_str()); } -#pragma mark Sources +// MARK: Sources - (NSSet<__kindof MGLSource *> *)sources { auto rawSources = self.rawStyle->getSources(); @@ -263,7 +263,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return infos; } -#pragma mark Style layers +// MARK: Style layers - (NSArray<__kindof MGLStyleLayer *> *)layers { @@ -489,7 +489,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou [self didChangeValueForKey:@"layers"]; } -#pragma mark Style images +// MARK: Style images - (void)setImage:(MGLImage *)image forName:(NSString *)name { @@ -529,7 +529,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return styleImage ? [[MGLImage alloc] initWithMGLStyleImage:*styleImage] : nil; } -#pragma mark Style transitions +// MARK: Style transitions - (void)setTransition:(MGLTransition)transition { @@ -556,7 +556,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou return transitionOptions.enablePlacementTransitions; } -#pragma mark Style light +// MARK: Style light - (void)setLight:(MGLLight *)light { @@ -579,7 +579,7 @@ const MGLExceptionName MGLRedundantSourceIdentifierException = @"MGLRedundantSou self.URL ? [NSString stringWithFormat:@"\"%@\"", self.URL] : self.URL]; } -#pragma mark Mapbox Streets source introspection +// MARK: Mapbox Streets source introspection - (void)localizeLabelsIntoLocale:(nullable NSLocale *)locale { NSSet *streetsSources = diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer.h b/platform/ios/platform/darwin/src/MGLStyleLayer.h index 785a8db7b..c11380910 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLStyleLayer.h @@ -27,11 +27,11 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLInvalidStyleLayerExceptio MGL_EXPORT @interface MGLStyleLayer : NSObject -#pragma mark Initializing a Style Layer +// MARK: Initializing a Style Layer - (instancetype)init __attribute__((unavailable("Use -init methods of concrete subclasses instead."))); -#pragma mark Identifying a Style Layer +// MARK: Identifying a Style Layer /** A string that uniquely identifies the style layer in the style to which it is @@ -39,7 +39,7 @@ MGL_EXPORT */ @property (nonatomic, copy, readonly) NSString *identifier; -#pragma mark Configuring a Style Layer’s Visibility +// MARK: Configuring a Style Layer’s Visibility /** Whether this layer is displayed. A value of `NO` hides the layer. diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer.h.ejs b/platform/ios/platform/darwin/src/MGLStyleLayer.h.ejs index 91ba813b1..e23f614b7 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer.h.ejs +++ b/platform/ios/platform/darwin/src/MGLStyleLayer.h.ejs @@ -119,7 +119,7 @@ which it is added. <% } -%> <% if (layoutProperties.length) { -%> -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes <% for (const property of layoutProperties) { -%> /** @@ -139,7 +139,7 @@ which it is added. <% } -%> <% } -%> <% if (paintProperties.length) { -%> -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes <% for (const property of paintProperties) { -%> /** @@ -176,7 +176,7 @@ which it is added. */ @interface NSValue (MGL<%- camelize(type) %>StyleLayerAdditions) -#pragma mark Working with <%- camelize(unhyphenate(type)) %> Style Layer Attribute Values +// MARK: Working with <%- camelize(unhyphenate(type)) %> Style Layer Attribute Values <% for (let property of enumProperties) { -%> /** diff --git a/platform/ios/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/ios/platform/darwin/src/MGLStyleLayer.mm.ejs index 5664f7fd4..8c3e1839c 100644 --- a/platform/ios/platform/darwin/src/MGLStyleLayer.mm.ejs +++ b/platform/ios/platform/darwin/src/MGLStyleLayer.mm.ejs @@ -122,7 +122,7 @@ namespace mbgl { <% }} -%> <% if (layoutProperties.length) { -%> -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes <% for (const property of layoutProperties) { -%> - (void)set<%- camelize(property.name) %>:(NSExpression *)<%- objCName(property) %> { @@ -177,7 +177,7 @@ namespace mbgl { <% } -%> <% } -%> <% if (paintProperties.length) { -%> -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes <% for (const property of paintProperties) { -%> - (void)set<%- camelize(property.name) %>:(NSExpression *)<%- objCName(property) %> { diff --git a/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.h b/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.h index d62518c49..e5d262dc8 100644 --- a/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.h @@ -432,7 +432,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier source:(MGLSource *)source; -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes /** If true, the icon will be visible even if it collides with other previously @@ -1714,7 +1714,7 @@ MGL_EXPORT @property (nonatomic, null_resettable) NSExpression *textWritingMode __attribute__((unavailable("Use textWritingModes instead."))); -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes #if TARGET_OS_IPHONE /** @@ -2305,7 +2305,7 @@ MGL_EXPORT */ @interface NSValue (MGLSymbolStyleLayerAdditions) -#pragma mark Working with Symbol Style Layer Attribute Values +// MARK: Working with Symbol Style Layer Attribute Values /** Creates a new value object containing the given `MGLIconAnchor` enumeration. diff --git a/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.mm b/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.mm index 966386e0f..6cd2c5ad1 100644 --- a/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.mm +++ b/platform/ios/platform/darwin/src/MGLSymbolStyleLayer.mm @@ -171,7 +171,7 @@ namespace mbgl { return [NSPredicate mgl_predicateWithFilter:self.rawLayer->getFilter()]; } -#pragma mark - Accessing the Layout Attributes +// MARK: - Accessing the Layout Attributes - (void)setIconAllowsOverlap:(NSExpression *)iconAllowsOverlap { MGLAssertStyleLayerIsValid(); @@ -1053,7 +1053,7 @@ namespace mbgl { return self.textWritingModes; } -#pragma mark - Accessing the Paint Attributes +// MARK: - Accessing the Paint Attributes - (void)setIconColor:(NSExpression *)iconColor { MGLAssertStyleLayerIsValid(); diff --git a/platform/ios/platform/darwin/src/MGLTileSource.h b/platform/ios/platform/darwin/src/MGLTileSource.h index f22babc8c..64347cc7e 100644 --- a/platform/ios/platform/darwin/src/MGLTileSource.h +++ b/platform/ios/platform/darwin/src/MGLTileSource.h @@ -178,7 +178,7 @@ typedef NS_ENUM(NSUInteger, MGLDEMEncoding) { MGL_EXPORT @interface MGLTileSource : MGLSource -#pragma mark Accessing a Source’s Content +// MARK: Accessing a Source’s Content /** The URL to the TileJSON configuration file that specifies the contents of the @@ -189,7 +189,7 @@ MGL_EXPORT */ @property (nonatomic, copy, nullable, readonly) NSURL *configurationURL; -#pragma mark Accessing Attribution Strings +// MARK: Accessing Attribution Strings /** An array of `MGLAttributionInfo` objects that define the attribution diff --git a/platform/ios/platform/darwin/src/MGLVectorStyleLayer.h b/platform/ios/platform/darwin/src/MGLVectorStyleLayer.h index d9431215a..87853b893 100644 --- a/platform/ios/platform/darwin/src/MGLVectorStyleLayer.h +++ b/platform/ios/platform/darwin/src/MGLVectorStyleLayer.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN MGL_EXPORT @interface MGLVectorStyleLayer : MGLForegroundStyleLayer -#pragma mark Refining a Style Layer’s Content +// MARK: Refining a Style Layer’s Content /** Identifier of the layer within the source identified by the `sourceIdentifier` diff --git a/platform/ios/platform/darwin/src/MGLVectorTileSource.h b/platform/ios/platform/darwin/src/MGLVectorTileSource.h index ebd95f647..e594adeb3 100644 --- a/platform/ios/platform/darwin/src/MGLVectorTileSource.h +++ b/platform/ios/platform/darwin/src/MGLVectorTileSource.h @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN MGL_EXPORT @interface MGLVectorTileSource : MGLTileSource -#pragma mark Initializing a Source +// MARK: Initializing a Source /** Returns a vector tile source initialized with an identifier and configuration @@ -105,7 +105,7 @@ MGL_EXPORT */ - (instancetype)initWithIdentifier:(NSString *)identifier tileURLTemplates:(NSArray *)tileURLTemplates options:(nullable NSDictionary *)options NS_DESIGNATED_INITIALIZER; -#pragma mark Accessing a Source’s Content +// MARK: Accessing a Source’s Content /** Returns an array of map features loaded by this source, restricted to the given diff --git a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.h b/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.h index 38c7a4d03..385611443 100644 --- a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.h @@ -47,7 +47,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI */ @interface NSExpression (MGLAdditions) -#pragma mark Creating Variable Expressions +// MARK: Creating Variable Expressions /** `NSExpression` variable that corresponds to the @@ -100,7 +100,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI @property (class, nonatomic, readonly) NSExpression *featurePropertiesVariableExpression __attribute__((deprecated("", "featureAttributesVariableExpression"))); -#pragma mark Creating Conditional Expressions +// MARK: Creating Conditional Expressions /** Returns a conditional function expression specifying the string predicate, and @@ -112,7 +112,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI */ + (instancetype)mgl_expressionForConditional:(nonnull NSPredicate *)conditionPredicate trueExpression:(nonnull NSExpression *)trueExpression falseExpresssion:(nonnull NSExpression *)falseExpression NS_SWIFT_NAME(init(forMGLConditional:trueExpression:falseExpression:)); -#pragma mark Creating Ramp, Scale, and Curve Expressions +// MARK: Creating Ramp, Scale, and Curve Expressions /** Returns a step function expression specifying the stepping, from expression @@ -167,7 +167,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI */ + (instancetype)mgl_expressionForAttributedExpressions:(nonnull NSArray *)attributedExpressions NS_SWIFT_NAME(init(forAttributedExpressions:)); -#pragma mark Concatenating String Expressions +// MARK: Concatenating String Expressions /** Returns a constant expression appending the passed expression. @@ -179,7 +179,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI */ - (instancetype)mgl_expressionByAppendingExpression:(nonnull NSExpression *)expression NS_SWIFT_NAME(mgl_appending(_:)); -#pragma mark Converting JSON Expressions +// MARK: Converting JSON Expressions /** Returns an expression equivalent to the given Foundation object deserialized @@ -214,7 +214,7 @@ FOUNDATION_EXTERN MGL_EXPORT const MGLExpressionInterpolationMode MGLExpressionI */ @property (nonatomic, readonly) id mgl_jsonExpressionObject; -#pragma mark Localizing the Expression +// MARK: Localizing the Expression /** Returns a copy of the receiver localized into the given locale. diff --git a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm b/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm index 920718558..5eff80e8d 100644 --- a/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm +++ b/platform/ios/platform/darwin/src/NSExpression+MGLAdditions.mm @@ -1515,7 +1515,7 @@ NSArray *MGLSubexpressionsWithJSONObjects(NSArray *objects) { return expressionObject; } -#pragma mark Localization +// MARK: Localization /** Returns a localized copy of the given collection. diff --git a/platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.h b/platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.h index f6717f356..48752b7ef 100644 --- a/platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSPredicate+MGLAdditions.h @@ -4,7 +4,7 @@ NS_ASSUME_NONNULL_BEGIN @interface NSPredicate (MGLAdditions) -#pragma mark Converting JSON Expressions +// MARK: Converting JSON Expressions /** Returns a predicate equivalent to the given Foundation object deserialized diff --git a/platform/ios/platform/darwin/src/NSValue+MGLAdditions.h b/platform/ios/platform/darwin/src/NSValue+MGLAdditions.h index 9222f0462..553fda0e0 100644 --- a/platform/ios/platform/darwin/src/NSValue+MGLAdditions.h +++ b/platform/ios/platform/darwin/src/NSValue+MGLAdditions.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN */ @interface NSValue (MGLAdditions) -#pragma mark Working with Geographic Coordinate Values +// MARK: Working with Geographic Coordinate Values /** Creates a new value object containing the specified Core Location geographic @@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (MGLCoordinateQuad)MGLCoordinateQuadValue; -#pragma mark Working with Offline Map Values +// MARK: Working with Offline Map Values /** Creates a new value object containing the given `MGLOfflinePackProgress` @@ -99,7 +99,7 @@ NS_ASSUME_NONNULL_BEGIN */ @property (readonly) MGLOfflinePackProgress MGLOfflinePackProgressValue; -#pragma mark Working with Transition Values +// MARK: Working with Transition Values /** Creates a new value object containing the given `MGLTransition` diff --git a/platform/ios/platform/darwin/src/NSValue+MGLAdditions.m b/platform/ios/platform/darwin/src/NSValue+MGLAdditions.m index 8f12066cc..52f26ecee 100644 --- a/platform/ios/platform/darwin/src/NSValue+MGLAdditions.m +++ b/platform/ios/platform/darwin/src/NSValue+MGLAdditions.m @@ -2,7 +2,7 @@ @implementation NSValue (MGLAdditions) -#pragma mark Geometry +// MARK: Geometry + (instancetype)valueWithMGLCoordinate:(CLLocationCoordinate2D)coordinate { return [self valueWithBytes:&coordinate objCType:@encode(CLLocationCoordinate2D)]; @@ -54,7 +54,7 @@ return quad; } -#pragma mark Offline maps +// MARK: Offline maps + (NSValue *)valueWithMGLOfflinePackProgress:(MGLOfflinePackProgress)progress { return [NSValue value:&progress withObjCType:@encode(MGLOfflinePackProgress)]; @@ -66,7 +66,7 @@ return progress; } -#pragma mark Working with Transition Values +// MARK: Working with Transition Values + (NSValue *)valueWithMGLTransition:(MGLTransition)transition { return [NSValue value:&transition withObjCType:@encode(MGLTransition)]; diff --git a/platform/ios/platform/darwin/test/MGLExpressionTests.mm b/platform/ios/platform/darwin/test/MGLExpressionTests.mm index deeb9aed6..d4037753e 100644 --- a/platform/ios/platform/darwin/test/MGLExpressionTests.mm +++ b/platform/ios/platform/darwin/test/MGLExpressionTests.mm @@ -43,7 +43,7 @@ using namespace std::string_literals; @implementation MGLExpressionTests -#pragma mark - Utility +// MARK: - Utility - (NSComparisonPredicate *)equalityComparisonPredicateWithRightConstantValue:(id)rightConstantValue { @@ -56,7 +56,7 @@ using namespace std::string_literals; return predicate; } -#pragma mark - Objective-C Example Code for MGL Expressions +// MARK: - Objective-C Example Code for MGL Expressions - (void)testSteppingExpression { //#-example-code @@ -131,7 +131,7 @@ using namespace std::string_literals; NSLog(@"%s %@", __FUNCTION__, functionExpression); } -#pragma mark - Valuation tests +// MARK: - Valuation tests - (void)testStringValuation { MGLAssertConstantEqualsValue(@"bar", "bar"s, @"NSString should convert to std::string."); @@ -208,7 +208,7 @@ using namespace std::string_literals; MGLAssertConstantEqualsValue([NSNull null], nullValue, @"NSNull should convert to mbgl::NullValue."); } -#pragma mark - Feature type tests +// MARK: - Feature type tests - (void)testFeatureType { XCTAssertEqual([NSExpression expressionForConstantValue:@"Point"].mgl_featureType, mbgl::FeatureType::Point); @@ -227,7 +227,7 @@ using namespace std::string_literals; XCTAssertEqual([NSExpression expressionForConstantValue:nil].mgl_featureType, mbgl::FeatureType::Unknown); } -#pragma mark - JSON expression object tests +// MARK: - JSON expression object tests - (void)testVariableExpressionObject { { @@ -1373,7 +1373,7 @@ using namespace std::string_literals; } } -#pragma mark - Localization tests +// MARK: - Localization tests - (void)testLocalization { { @@ -1548,7 +1548,7 @@ using namespace std::string_literals; } -#pragma mark - Objective-C Example Code for Expected Failures +// MARK: - Objective-C Example Code for Expected Failures - (void)testExpectPassObjC { XCTAssertNotNil(@1); diff --git a/platform/ios/platform/darwin/test/MGLMapSnapshotterTests.m b/platform/ios/platform/darwin/test/MGLMapSnapshotterTests.m index 8e6e0f668..9e5f0718a 100644 --- a/platform/ios/platform/darwin/test/MGLMapSnapshotterTests.m +++ b/platform/ios/platform/darwin/test/MGLMapSnapshotterTests.m @@ -214,7 +214,7 @@ MGLImage *MGLImageFromCurrentContext(void) { self.runtimeStylingActions = nil; } -#pragma mark MGLMapSnapshotterDelegate methods +// MARK: MGLMapSnapshotterDelegate methods - (void)mapSnapshotter:(MGLMapSnapshotter *)snapshotter didFinishLoadingStyle:(MGLStyle *)style { XCTAssertNotNil(snapshotter); @@ -227,7 +227,7 @@ MGLImage *MGLImageFromCurrentContext(void) { [self.styleLoadingExpectation fulfill]; } -#pragma mark MGLOfflineStorageDelegate methods +// MARK: MGLOfflineStorageDelegate methods - (NSURL *)offlineStorage:(MGLOfflineStorage *)storage URLForResourceOfKind:(MGLResourceKind)kind withURL:(NSURL *)url { if (kind == MGLResourceKindGlyphs && [url.scheme isEqualToString:@"local"]) { diff --git a/platform/ios/platform/darwin/test/MGLStyleTests.mm b/platform/ios/platform/darwin/test/MGLStyleTests.mm index 2f995b555..09d390814 100644 --- a/platform/ios/platform/darwin/test/MGLStyleTests.mm +++ b/platform/ios/platform/darwin/test/MGLStyleTests.mm @@ -353,7 +353,7 @@ XCTAssertEqualObjects(layers[startIndex++].identifier, layer4.identifier); } -#pragma mark Localization tests +// MARK: Localization tests - (void)testLanguageMatching { { @@ -398,7 +398,7 @@ } } -#pragma mark Transition tests +// MARK: Transition tests - (void)testTransition { diff --git a/platform/ios/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.mm b/platform/ios/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.mm index 381a13664..cf89e275b 100644 --- a/platform/ios/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.mm +++ b/platform/ios/platform/ios/Integration Tests/Annotation Tests/MGLAnnotationViewIntegrationTests.mm @@ -40,7 +40,7 @@ @implementation MGLAnnotationViewIntegrationTests -#pragma mark - Offscreen/panning selection tests +// MARK: - Offscreen/panning selection tests typedef struct PanTestData { CGPoint relativeCoord; @@ -413,7 +413,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; [self internalRunTests:tests]; } -#pragma mark - Selection with an offset +// MARK: - Selection with an offset - (void)testSelectingAnnotationWithCenterOffset { @@ -521,7 +521,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; XCTAssertEqual(originalFrame.origin.y + offset.y, offsetFrame.origin.y); } -#pragma mark - Rotating/zooming +// MARK: - Rotating/zooming - (void)testSelectingAnnotationWhenMapIsRotated { @@ -782,7 +782,7 @@ static const CGPoint kAnnotationRelativeScale = { 0.05f, 0.125f }; } -#pragma mark - Utilities +// MARK: - Utilities - (void)runRunLoop { [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; diff --git a/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionFinishTests.mm b/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionFinishTests.mm index 1f4624d4a..883aa3b8c 100644 --- a/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionFinishTests.mm +++ b/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionFinishTests.mm @@ -80,7 +80,7 @@ } @end -#pragma mark - camera transitions with NaN values +// MARK: - camera transitions with NaN values @interface MGLMapView (MGLCameraTransitionFinishNaNTests) - (mbgl::CameraOptions)cameraOptionsObjectForAnimatingToCamera:(MGLMapCamera *)camera edgePadding:(UIEdgeInsets)insets; diff --git a/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionTests.mm b/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionTests.mm index b8b127b56..4a5e473b7 100644 --- a/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionTests.mm +++ b/platform/ios/platform/ios/Integration Tests/Camera Tests/MGLCameraTransitionTests.mm @@ -331,7 +331,7 @@ XCTAssert(delegateCallCount == 2, @"Expecting 2 regionDidChange callbacks, got %ld", (long)delegateCallCount); // Once for the setDirection and once for the reset north } -#pragma mark - Pending tests +// MARK: - Pending tests - (void)testContinuallyResettingNorthInIsChanging🙁{ // See https://github.com/mapbox/mapbox-gl-native/pull/11614 diff --git a/platform/ios/platform/ios/Integration Tests/MBGLIntegrationTests.mm b/platform/ios/platform/ios/Integration Tests/MBGLIntegrationTests.mm index d0f5f6a79..1ed7f63bd 100644 --- a/platform/ios/platform/ios/Integration Tests/MBGLIntegrationTests.mm +++ b/platform/ios/platform/ios/Integration Tests/MBGLIntegrationTests.mm @@ -9,7 +9,7 @@ @implementation MBGLIntegrationTests -#pragma mark - Tests +// MARK: - Tests - (void)waitForMapViewToBeRendered { [self waitForMapViewToBeRenderedWithTimeout:10]; diff --git a/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m b/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m index 191ce360e..b9f103072 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m +++ b/platform/ios/platform/ios/Integration Tests/MGLMapViewIntegrationTest.m @@ -41,7 +41,7 @@ [super tearDown]; } -#pragma mark - MGLMapViewDelegate +// MARK: - MGLMapViewDelegate - (MGLAnnotationView*)mapView:(MGLMapView *)mapView viewForAnnotation:(id)annotation { if (self.viewForAnnotation) { @@ -102,7 +102,7 @@ return nil; } -#pragma mark - Utilities +// MARK: - Utilities - (void)waitForMapViewToFinishLoadingStyleWithTimeout:(NSTimeInterval)timeout { XCTAssertNil(self.styleLoadingExpectation); diff --git a/platform/ios/platform/ios/Integration Tests/MGLMapViewPendingBlockTests.m b/platform/ios/platform/ios/Integration Tests/MGLMapViewPendingBlockTests.m index 2cdc88226..0a5c864f2 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLMapViewPendingBlockTests.m +++ b/platform/ios/platform/ios/Integration Tests/MGLMapViewPendingBlockTests.m @@ -195,7 +195,7 @@ } -#pragma mark - test interrupting regular rendering +// MARK: - test interrupting regular rendering - (void)testSetCenterCoordinateSetHidden { @@ -302,7 +302,7 @@ addToPendingCallback:addedToPending]; } -#pragma mark - Shared utility methods +// MARK: - Shared utility methods - (void)internalTestCompletionBlockAddedToPendingForTestName:(NSString *)testName transition:(void (^)(dispatch_block_t))transition diff --git a/platform/ios/platform/ios/Integration Tests/MGLNetworkConfigurationIntegrationTests.mm b/platform/ios/platform/ios/Integration Tests/MGLNetworkConfigurationIntegrationTests.mm index 74f222a0c..fb384956a 100644 --- a/platform/ios/platform/ios/Integration Tests/MGLNetworkConfigurationIntegrationTests.mm +++ b/platform/ios/platform/ios/Integration Tests/MGLNetworkConfigurationIntegrationTests.mm @@ -313,7 +313,7 @@ @end -#pragma mark - MGLNetworkConfiguration delegate +// MARK: - MGLNetworkConfiguration delegate @implementation MGLNetworkConfigurationTestDelegate - (NSURLSession *)sessionForNetworkConfiguration:(MGLNetworkConfiguration *)configuration { @@ -325,7 +325,7 @@ } @end -#pragma mark - NSURLSession delegate +// MARK: - NSURLSession delegate @implementation MGLNetworkConfigurationSessionDelegate - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler { @@ -338,7 +338,7 @@ } @end -#pragma mark - NSURLSession data delegate +// MARK: - NSURLSession data delegate @implementation MGLNetworkConfigurationSessionDataDelegate - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask didReceiveData:(NSData *)data { diff --git a/platform/ios/platform/ios/app/MBXAppDelegate.m b/platform/ios/platform/ios/app/MBXAppDelegate.m index 0e5095ad1..9ae42ba5b 100644 --- a/platform/ios/platform/ios/app/MBXAppDelegate.m +++ b/platform/ios/platform/ios/app/MBXAppDelegate.m @@ -19,7 +19,7 @@ return YES; } -#pragma mark - Quick actions +// MARK: - Quick actions - (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL))completionHandler { completionHandler([self handleShortcut:shortcutItem]); diff --git a/platform/ios/platform/ios/app/MBXCustomCalloutView.m b/platform/ios/platform/ios/app/MBXCustomCalloutView.m index 2d70e8b7b..b6a1bdd8d 100644 --- a/platform/ios/platform/ios/app/MBXCustomCalloutView.m +++ b/platform/ios/platform/ios/app/MBXCustomCalloutView.m @@ -37,7 +37,7 @@ static CGFloat const tipWidth = 10.0; return self; } -#pragma mark - API +// MARK: - API - (void)presentCalloutFromRect:(CGRect)rect inView:(nonnull UIView *)view constrainedToRect:(__unused CGRect)constrainedRect animated:(BOOL)animated { @@ -78,7 +78,7 @@ static CGFloat const tipWidth = 10.0; [self removeFromSuperview]; } -#pragma mark - internals +// MARK: - internals - (void)drawRect:(CGRect)rect { diff --git a/platform/ios/platform/ios/app/MBXCustomLocationViewController.m b/platform/ios/platform/ios/app/MBXCustomLocationViewController.m index c77d990ba..9c7bdc156 100644 --- a/platform/ios/platform/ios/app/MBXCustomLocationViewController.m +++ b/platform/ios/platform/ios/app/MBXCustomLocationViewController.m @@ -91,7 +91,7 @@ self.delegate = nil; } -#pragma mark - Location Updates +// MARK: - Location Updates - (void)loadRouteCoordinates { diff --git a/platform/ios/platform/ios/app/MBXEmbeddedMapViewController.m b/platform/ios/platform/ios/app/MBXEmbeddedMapViewController.m index dacbdb512..1d12708da 100644 --- a/platform/ios/platform/ios/app/MBXEmbeddedMapViewController.m +++ b/platform/ios/platform/ios/app/MBXEmbeddedMapViewController.m @@ -63,13 +63,13 @@ typedef NS_ENUM(NSInteger, MBXEmbeddedControl) { } } -#pragma mark UIScrollViewDelegate methods +// MARK: UIScrollViewDelegate methods - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { return self.mapView; } -#pragma mark Class method +// MARK: Class method + (NSString *)titleForControl:(MBXEmbeddedControl) control { switch (control) { diff --git a/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.m b/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.m index bc8407a46..84f9ebc0e 100644 --- a/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.m +++ b/platform/ios/platform/ios/app/MBXOfflinePacksTableViewController.m @@ -142,7 +142,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac } -#pragma mark - Table view data source +// MARK: - Table view data source - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [MGLOfflineStorage sharedOfflineStorage].packs.count; @@ -209,7 +209,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac } } -#pragma mark - Table view delegate +// MARK: - Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; @@ -240,7 +240,7 @@ static NSString * const MBXOfflinePacksTableViewActiveCellReuseIdentifier = @"Ac } } -#pragma mark - Offline pack delegate +// MARK: - Offline pack delegate - (void)offlinePackProgressDidChange:(NSNotification *)notification { MGLOfflinePack *pack = notification.object; diff --git a/platform/ios/platform/ios/app/MBXViewController.m b/platform/ios/platform/ios/app/MBXViewController.m index 3bf5c0038..c5ae6fe81 100644 --- a/platform/ios/platform/ios/app/MBXViewController.m +++ b/platform/ios/platform/ios/app/MBXViewController.m @@ -229,7 +229,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { UIEdgeInsets _originalContentInsets; } -#pragma mark - Setup & Teardown +// MARK: - Setup & Teardown - (void)viewDidLoad { @@ -319,7 +319,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [[NSNotificationCenter defaultCenter] removeObserver:self]; } -#pragma mark - Debugging Interface +// MARK: - Debugging Interface - (IBAction)showSettings:(__unused id)sender { @@ -793,7 +793,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { }]; } -#pragma mark - Debugging Actions +// MARK: - Debugging Actions - (void)parseFeaturesAddingCount:(NSUInteger)featuresCount usingViews:(BOOL)useViews { @@ -1714,7 +1714,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { return backupImage; } -#pragma mark - Random World Tour +// MARK: - Random World Tour - (void)addAnnotations:(NSInteger)numAnnotations aroundCoordinate:(CLLocationCoordinate2D)coordinate radius:(CLLocationDistance)radius { NSMutableArray *annotations = [[NSMutableArray alloc] initWithCapacity:numAnnotations]; @@ -1860,7 +1860,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { } } -#pragma mark - User Actions +// MARK: - User Actions - (void)handleSingleTap:(UITapGestureRecognizer *)singleTap { [self.navigationController setNavigationBarHidden:!self.navigationController.navigationBarHidden animated:YES]; @@ -1968,7 +1968,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [sender setAccessibilityValue:nextAccessibilityValue]; } -#pragma mark - UIViewDelegate +// MARK: - UIViewDelegate - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { @@ -1985,7 +1985,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { } } -#pragma mark - MGLMapViewDelegate +// MARK: - MGLMapViewDelegate - (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id)annotation { @@ -2270,7 +2270,7 @@ CLLocationCoordinate2D randomWorldCoordinate(void) { [self.hudLabel setTitle:hudString forState:UIControlStateNormal]; } -#pragma mark - MGLComputedShapeSourceDataSource +// MARK: - MGLComputedShapeSourceDataSource - (NSArray>*)featuresInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoom { double gridSpacing; diff --git a/platform/ios/platform/ios/app/MGLMapView_Experimental.h b/platform/ios/platform/ios/app/MGLMapView_Experimental.h index 94f8d67fb..be6d27388 100644 --- a/platform/ios/platform/ios/app/MGLMapView_Experimental.h +++ b/platform/ios/platform/ios/app/MGLMapView_Experimental.h @@ -2,7 +2,7 @@ @interface MGLMapView (Experimental) -#pragma mark Rendering Performance Measurement +// MARK: Rendering Performance Measurement /** Enable rendering performance measurement. */ @property (nonatomic) BOOL experimental_enableFrameRateMeasurement; diff --git a/platform/ios/platform/ios/benchmark/MBXBenchViewController.mm b/platform/ios/platform/ios/benchmark/MBXBenchViewController.mm index 6ec3487c2..5f6b96f0e 100644 --- a/platform/ios/platform/ios/benchmark/MBXBenchViewController.mm +++ b/platform/ios/platform/ios/benchmark/MBXBenchViewController.mm @@ -15,7 +15,7 @@ @implementation MBXBenchViewController -#pragma mark - Setup +// MARK: - Setup + (void)initialize { diff --git a/platform/ios/platform/ios/src/MGLAnnotationContainerView.m b/platform/ios/platform/ios/src/MGLAnnotationContainerView.m index 6c82a1836..ed278b61c 100644 --- a/platform/ios/platform/ios/src/MGLAnnotationContainerView.m +++ b/platform/ios/platform/ios/src/MGLAnnotationContainerView.m @@ -35,7 +35,7 @@ } } -#pragma mark UIAccessibility methods +// MARK: UIAccessibility methods - (UIAccessibilityTraits)accessibilityTraits { return UIAccessibilityTraitAdjustable; diff --git a/platform/ios/platform/ios/src/MGLAnnotationImage.h b/platform/ios/platform/ios/src/MGLAnnotationImage.h index 10b13a58c..c49f2b242 100644 --- a/platform/ios/platform/ios/src/MGLAnnotationImage.h +++ b/platform/ios/platform/ios/src/MGLAnnotationImage.h @@ -18,7 +18,7 @@ NS_ASSUME_NONNULL_BEGIN MGL_EXPORT @interface MGLAnnotationImage : NSObject -#pragma mark Initializing and Preparing the Image Object +// MARK: Initializing and Preparing the Image Object /** Initializes and returns a new annotation image object. @@ -31,7 +31,7 @@ MGL_EXPORT */ + (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier; -#pragma mark Getting and Setting Attributes +// MARK: Getting and Setting Attributes /** The image to be displayed for the annotation. */ @property (nonatomic, strong, nullable) UIImage *image; diff --git a/platform/ios/platform/ios/src/MGLAnnotationView.h b/platform/ios/platform/ios/src/MGLAnnotationView.h index afedeb790..53ab805bd 100644 --- a/platform/ios/platform/ios/src/MGLAnnotationView.h +++ b/platform/ios/platform/ios/src/MGLAnnotationView.h @@ -55,7 +55,7 @@ typedef NS_ENUM(NSUInteger, MGLAnnotationViewDragState) { MGL_EXPORT @interface MGLAnnotationView : UIView -#pragma mark Initializing and Preparing the View +// MARK: Initializing and Preparing the View /** Initializes and returns a new annotation view object. @@ -137,7 +137,7 @@ MGL_EXPORT */ @property (nonatomic, readonly, nullable) NSString *reuseIdentifier; -#pragma mark Configuring the Appearance +// MARK: Configuring the Appearance /** The offset, measured in points, at which to place the center of the view. @@ -191,7 +191,7 @@ MGL_EXPORT */ @property (nonatomic, assign) BOOL rotatesToMatchCamera; -#pragma mark Managing the Selection State +// MARK: Managing the Selection State /** A Boolean value indicating whether the annotation view is currently selected. @@ -240,7 +240,7 @@ MGL_EXPORT */ @property (nonatomic, assign, getter=isEnabled) BOOL enabled; -#pragma mark Supporting Drag Operations +// MARK: Supporting Drag Operations /** A Boolean value indicating whether the annotation view is draggable. diff --git a/platform/ios/platform/ios/src/MGLAnnotationView.mm b/platform/ios/platform/ios/src/MGLAnnotationView.mm index 3a2aa60f6..e0978112f 100644 --- a/platform/ios/platform/ios/src/MGLAnnotationView.mm +++ b/platform/ios/platform/ios/src/MGLAnnotationView.mm @@ -211,7 +211,7 @@ _lastAppliedRotationTransform = newRotationTransform; } -#pragma mark - Draggable +// MARK: - Draggable - (void)setDraggable:(BOOL)draggable { @@ -345,7 +345,7 @@ return otherGestureRecognizer == _longPressRecognizer || otherGestureRecognizer == _panGestureRecognizer; } -#pragma mark UIAccessibility methods +// MARK: UIAccessibility methods - (BOOL)isAccessibilityElement { return !self.hidden; diff --git a/platform/ios/platform/ios/src/MGLMapView.h b/platform/ios/platform/ios/src/MGLMapView.h index 0a6d417c8..dfecef4fb 100644 --- a/platform/ios/platform/ios/src/MGLMapView.h +++ b/platform/ios/platform/ios/src/MGLMapView.h @@ -191,7 +191,7 @@ FOUNDATION_EXTERN MGL_EXPORT MGLExceptionName const MGLUserLocationAnnotationTyp MGL_EXPORT @interface MGLMapView : UIView -#pragma mark Creating Instances +// MARK: Creating Instances /** Initializes and returns a newly allocated map view with the specified frame @@ -225,7 +225,7 @@ MGL_EXPORT */ - (instancetype)initWithFrame:(CGRect)frame styleURL:(nullable NSURL *)styleURL; -#pragma mark Accessing the Delegate +// MARK: Accessing the Delegate /** The receiver’s delegate. @@ -237,7 +237,7 @@ MGL_EXPORT */ @property(nonatomic, weak, nullable) IBOutlet id delegate; -#pragma mark Configuring the Map’s Appearance +// MARK: Configuring the Map’s Appearance /** The style currently displayed in the receiver. @@ -449,7 +449,7 @@ MGL_EXPORT */ @property (nonatomic, assign) BOOL prefetchesTiles; -#pragma mark Displaying the User’s Location +// MARK: Displaying the User’s Location /** The object that this map view uses to start and stop the delivery of @@ -671,7 +671,7 @@ MGL_EXPORT */ - (void)setTargetCoordinate:(CLLocationCoordinate2D)targetCoordinate animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion; -#pragma mark Configuring How the User Interacts with the Map +// MARK: Configuring How the User Interacts with the Map /** A Boolean value that determines whether the user may zoom the map in and @@ -772,7 +772,7 @@ MGL_EXPORT */ @property(nonatomic) CGFloat decelerationRate; -#pragma mark Manipulating the Viewpoint +// MARK: Manipulating the Viewpoint /** The geographic coordinate at the center of the map view. @@ -1453,7 +1453,7 @@ MGL_EXPORT */ - (void)setContentInset:(UIEdgeInsets)contentInset animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion; -#pragma mark Converting Geographic Coordinates +// MARK: Converting Geographic Coordinates /** Converts a point in the given view’s coordinate system to a geographic @@ -1540,7 +1540,7 @@ MGL_EXPORT */ - (MGLMapProjection*)mapProjection; -#pragma mark Annotating the Map +// MARK: Annotating the Map /** The complete list of annotations associated with the receiver. (read-only) @@ -1678,7 +1678,7 @@ MGL_EXPORT */ - (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect; -#pragma mark Managing Annotation Selections +// MARK: Managing Annotation Selections /** The currently selected annotations. @@ -1763,7 +1763,7 @@ MGL_EXPORT */ - (void)deselectAnnotation:(nullable id )annotation animated:(BOOL)animated; -#pragma mark Overlaying the Map +// MARK: Overlaying the Map /** The complete list of overlays associated with the receiver. (read-only) @@ -1813,7 +1813,7 @@ MGL_EXPORT */ - (void)removeOverlays:(NSArray> *)overlays; -#pragma mark Accessing the Underlying Map Data +// MARK: Accessing the Underlying Map Data /** Returns an array of rendered map features that intersect with a given point. @@ -2026,7 +2026,7 @@ MGL_EXPORT */ - (NSArray> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:)); -#pragma mark Debugging the Map +// MARK: Debugging the Map /** The options that determine which debugging aids are shown on the map. diff --git a/platform/ios/platform/ios/src/MGLMapView.mm b/platform/ios/platform/ios/src/MGLMapView.mm index a0cabc64c..f6000ca0f 100644 --- a/platform/ios/platform/ios/src/MGLMapView.mm +++ b/platform/ios/platform/ios/src/MGLMapView.mm @@ -351,7 +351,7 @@ public: NSString *viewReuseIdentifier; }; -#pragma mark - Private - +// MARK: - Private - @interface MGLMapView () getEAGLContext(); @@ -2091,7 +2091,7 @@ public: return YES; } -#pragma mark - Gestures - +// MARK: - Gestures - - (void)touchesBegan:(__unused NSSet *)touches withEvent:(__unused UIEvent *)event { @@ -2914,7 +2914,7 @@ public: return angleInDegrees; } -#pragma mark - Attribution - +// MARK: - Attribution - - (void)showAttribution:(id)sender { @@ -2961,7 +2961,7 @@ public: self.attributionController = attributionController; } -#pragma mark - Properties - +// MARK: - Properties - static void *windowScreenContext = &windowScreenContext; @@ -3207,7 +3207,7 @@ static void *windowScreenContext = &windowScreenContext; return self.mbglMap.getPrefetchZoomDelta() > 0 ? YES : NO; } -#pragma mark - Accessibility - +// MARK: - Accessibility - - (NSString *)accessibilityValue { @@ -3736,7 +3736,7 @@ static void *windowScreenContext = &windowScreenContext; _accessibilityValueAnnouncementIsPending = YES; } -#pragma mark - Geography - +// MARK: - Geography - + (NSSet *)keyPathsForValuesAffectingCenterCoordinate { @@ -4544,14 +4544,14 @@ static void *windowScreenContext = &windowScreenContext; return [[MGLMapProjection alloc] initWithMapView:self]; } -#pragma mark - Camera Change Reason - +// MARK: - Camera Change Reason - - (void)resetCameraChangeReason { self.cameraChangeReasonBitmask = MGLCameraChangeReasonNone; } -#pragma mark - Annotations - +// MARK: - Annotations - - (nullable NSArray> *)annotations { @@ -5798,7 +5798,7 @@ static void *windowScreenContext = &windowScreenContext; } -#pragma mark Annotation Image Delegate +// MARK: Annotation Image Delegate - (void)annotationImageNeedsRedisplay:(MGLAnnotationImage *)annotationImage { @@ -5846,7 +5846,7 @@ static void *windowScreenContext = &windowScreenContext; } } -#pragma mark - User Location - +// MARK: - User Location - - (void)setLocationManager:(nullable id)locationManager { @@ -6554,7 +6554,7 @@ static void *windowScreenContext = &windowScreenContext; } } -#pragma mark Data +// MARK: Data - (NSArray> *)visibleFeaturesAtPoint:(CGPoint)point { @@ -6629,7 +6629,7 @@ static void *windowScreenContext = &windowScreenContext; return MGLFeaturesFromMBGLFeatures(features); } -#pragma mark - Utility - +// MARK: - Utility - - (void)animateWithDelay:(NSTimeInterval)delay animations:(void (^)(void))animations { @@ -7383,7 +7383,7 @@ static void *windowScreenContext = &windowScreenContext; return _annotationViewReuseQueueByIdentifier[identifier]; } -#pragma mark - Snapshot image - +// MARK: - Snapshot image - - (void)attemptBackgroundSnapshot { static NSTimeInterval lastSnapshotTime = 0.0; @@ -7419,7 +7419,7 @@ static void *windowScreenContext = &windowScreenContext; @end -#pragma mark - IBAdditions methods +// MARK: - IBAdditions methods @implementation MGLMapView (IBAdditions) diff --git a/platform/ios/platform/ios/src/MGLMapViewDelegate.h b/platform/ios/platform/ios/src/MGLMapViewDelegate.h index e3ba90e05..2c33678fc 100644 --- a/platform/ios/platform/ios/src/MGLMapViewDelegate.h +++ b/platform/ios/platform/ios/src/MGLMapViewDelegate.h @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN @optional -#pragma mark Responding to Map Position Changes +// MARK: Responding to Map Position Changes /** Asks the delegate whether the map view should be allowed to change from the @@ -173,7 +173,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)mapView:(MGLMapView *)mapView regionDidChangeWithReason:(MGLCameraChangeReason)reason animated:(BOOL)animated; -#pragma mark Loading the Map +// MARK: Loading the Map /** Tells the delegate that the map view will begin to load. @@ -292,7 +292,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)mapView:(MGLMapView *)mapView shouldRemoveStyleImage:(NSString *)imageName; -#pragma mark Tracking User Location +// MARK: Tracking User Location /** Tells the delegate that the map view will begin tracking the user’s location. @@ -391,7 +391,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)mapView:(MGLMapView *)mapView didChangeLocationManagerAuthorization:(id)manager API_AVAILABLE(ios(14)); -#pragma mark Managing the Appearance of Annotations +// MARK: Managing the Appearance of Annotations /** Returns an annotation image object to mark the given point annotation object on @@ -496,7 +496,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (CGFloat)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation; -#pragma mark Managing Annotation Views +// MARK: Managing Annotation Views /** Returns a view object to mark the given point annotation object on the map. @@ -542,7 +542,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)mapView:(MGLMapView *)mapView didAddAnnotationViews:(NSArray *)annotationViews; -#pragma mark Selecting Annotations +// MARK: Selecting Annotations /** Returns a Boolean value indicating whether the shape annotation can be selected. @@ -621,7 +621,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)mapView:(MGLMapView *)mapView didDeselectAnnotationView:(MGLAnnotationView *)annotationView; -#pragma mark Managing Callout Views +// MARK: Managing Callout Views /** Returns a Boolean value indicating whether the annotation is able to display diff --git a/platform/ios/platform/ios/src/MGLScaleBar.mm b/platform/ios/platform/ios/src/MGLScaleBar.mm index 2aeb479ed..f1e4217ac 100644 --- a/platform/ios/platform/ios/src/MGLScaleBar.mm +++ b/platform/ios/platform/ios/src/MGLScaleBar.mm @@ -223,7 +223,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary [self addZeroLabel]; } -#pragma mark - Dimensions +// MARK: - Dimensions - (void)setBorderWidth:(CGFloat)borderWidth { _borderWidth = borderWidth; @@ -260,7 +260,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary return [self usesMetricSystem] ? self.metersPerPoint : self.metersPerPoint * MGLFeetPerMeter; } -#pragma mark - Convenience methods +// MARK: - Convenience methods - (BOOL)usesRightToLeftLayout { if (self.testingRightToLeftOverride) { @@ -302,7 +302,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary } -#pragma mark - Dark Mode Changes +// MARK: - Dark Mode Changes - (void)setShouldShowDarkStyles:(BOOL)shouldShowDarkStyles { @@ -318,7 +318,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary } -#pragma mark - Setters +// MARK: - Setters - (void)setUsesMetricSystem:(BOOL)usesMetricSystem { @@ -454,7 +454,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary _row = row; } -#pragma mark - Views +// MARK: - Views - (NSArray *)bars { if (!_bars) { @@ -469,7 +469,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary return _bars; } -#pragma mark - Labels +// MARK: - Labels - (void)addZeroLabel { NSDecimalNumber *zeroNumber = [NSDecimalNumber decimalNumberWithString:@"0"]; @@ -542,7 +542,7 @@ static const CGFloat MGLScaleBarMinimumBarWidth = 30.0; // Arbitrary } } -#pragma mark - Layout +// MARK: - Layout - (void)layoutSubviews { [super layoutSubviews]; diff --git a/platform/ios/platform/ios/src/MGLUserLocation.h b/platform/ios/platform/ios/src/MGLUserLocation.h index d7c8576c4..c10b27fef 100644 --- a/platform/ios/platform/ios/src/MGLUserLocation.h +++ b/platform/ios/platform/ios/src/MGLUserLocation.h @@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN MGL_EXPORT @interface MGLUserLocation : NSObject -#pragma mark Determining the User’s Position +// MARK: Determining the User’s Position /** The current location of the device. (read-only) @@ -44,7 +44,7 @@ MGL_EXPORT */ @property (nonatomic, readonly, nullable) CLHeading *heading; -#pragma mark Accessing the User Annotation Text +// MARK: Accessing the User Annotation Text /** The title to display for the user location annotation. */ @property (nonatomic, copy) NSString *title; diff --git a/platform/ios/platform/ios/test/MGLAnnotationViewTests.m b/platform/ios/platform/ios/test/MGLAnnotationViewTests.m index bb85ea8c8..ef2659c26 100644 --- a/platform/ios/platform/ios/test/MGLAnnotationViewTests.m +++ b/platform/ios/platform/ios/test/MGLAnnotationViewTests.m @@ -240,7 +240,7 @@ static NSString * const MGLTestAnnotationReuseIdentifer = @"MGLTestAnnotationReu XCTAssert(self.mapView.selectedAnnotations.count == 0, @"There should be 0 selected annotations"); } -#pragma mark - MGLMapViewDelegate - +// MARK: - MGLMapViewDelegate - - (MGLAnnotationView *)mapView:(MGLMapView *)mapView viewForAnnotation:(id)annotation { diff --git a/platform/ios/platform/macos/app/AppDelegate.m b/platform/ios/platform/macos/app/AppDelegate.m index eea5d9187..77dac7c55 100644 --- a/platform/ios/platform/macos/app/AppDelegate.m +++ b/platform/ios/platform/macos/app/AppDelegate.m @@ -80,7 +80,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; @implementation AppDelegate -#pragma mark Lifecycle +// MARK: Lifecycle + (void)load { [MGLSettings useWellKnownTileServer:MGLMapTiler]; @@ -155,7 +155,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; [self.offlinePacksArrayController unbind:@"content"]; } -#pragma mark Services +// MARK: Services - (void)handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent { // geo:29.95,-90.066667,3000 @@ -215,7 +215,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; [[NSDocumentController sharedDocumentController] openUntitledDocumentAndDisplay:YES error:NULL]; } -#pragma mark Offline pack management +// MARK: Offline pack management - (IBAction)showOfflinePacksPanel:(id)sender { [self.offlinePacksPanel makeKeyAndOrderFront:sender]; @@ -288,7 +288,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; [[NSSound soundNamed:@"Basso"] play]; } -#pragma mark Help methods +// MARK: Help methods - (IBAction)showShortcuts:(id)sender { NSAlert *alert = [[NSAlert alloc] init]; @@ -316,7 +316,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; } } -#pragma mark User interface validation +// MARK: User interface validation - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { if (menuItem.action == @selector(showShortcuts:)) { @@ -337,7 +337,7 @@ NSString * const MGLLastMapDebugMaskDefaultsKey = @"MGLLastMapDebugMask"; return NO; } -#pragma mark NSWindowDelegate methods +// MARK: NSWindowDelegate methods - (void)windowWillClose:(NSNotification *)notification { NSWindow *window = notification.object; diff --git a/platform/ios/platform/macos/app/MapDocument.m b/platform/ios/platform/macos/app/MapDocument.m index c2b5fb63c..515e1c49d 100644 --- a/platform/ios/platform/macos/app/MapDocument.m +++ b/platform/ios/platform/macos/app/MapDocument.m @@ -105,7 +105,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha MGLMapSnapshotter *_snapshotter; } -#pragma mark Lifecycle +// MARK: Lifecycle - (NSString *)windowNibName { return @"MapDocument"; @@ -153,7 +153,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } } -#pragma mark NSWindowDelegate methods +// MARK: NSWindowDelegate methods - (void)window:(NSWindow *)window willEncodeRestorableState:(NSCoder *)state { [state encodeObject:self.mapView.styleURL forKey:@"MBXMapViewStyleURL"]; @@ -165,7 +165,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha _isLocalizingLabels = [state decodeBoolForKey:@"MBXLocalizeLabels"]; } -#pragma mark Services +// MARK: Services - (IBAction)showShareMenu:(id)sender { NSSharingServicePicker *picker = [[NSSharingServicePicker alloc] initWithItems:@[self.shareURL]]; @@ -183,7 +183,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha camera.heading, camera.pitch]]; } -#pragma mark File methods +// MARK: File methods - (IBAction)import:(id)sender { NSOpenPanel *panel = [NSOpenPanel openPanel]; @@ -311,7 +311,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha }]; } -#pragma mark View methods +// MARK: View methods - (IBAction)showStyle:(id)sender { NSInteger tag = -1; @@ -522,7 +522,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha self.displayName = [NSString stringWithFormat:@"%@ @ %f", coordinateString, _mapView.zoomLevel]; } -#pragma mark Debug methods +// MARK: Debug methods - (IBAction)toggleTileBoundaries:(id)sender { self.mapView.debugMask ^= MGLMapDebugTileBoundariesMask; @@ -903,7 +903,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [self.mapView.style insertLayer:hillshadeLayer atIndex:hillshadeIndex]; } -#pragma mark Offline packs +// MARK: Offline packs - (IBAction)addOfflinePack:(id)sender { self.offlinePackNameField.stringValue = @""; @@ -952,7 +952,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [self.window endSheet:self.addOfflinePackWindow returnCode:[sender tag] ? NSModalResponseOK : NSModalResponseCancel]; } -#pragma mark Mouse events +// MARK: Mouse events - (void)handlePressGesture:(NSPressGestureRecognizer *)gestureRecognizer { if (gestureRecognizer.state == NSGestureRecognizerStateBegan) { @@ -1123,7 +1123,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha [self.mapView addAnnotations:flattenedFeatures]; } -#pragma mark User interface validation +// MARK: User interface validation - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { if (menuItem.action == @selector(showStyle:)) { @@ -1339,7 +1339,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return NO; } -#pragma mark NSSharingServicePickerDelegate methods +// MARK: NSSharingServicePickerDelegate methods - (NSArray *)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker sharingServicesForItems:(NSArray *)items proposedSharingServices:(NSArray *)proposedServices { NSURL *shareURL = self.shareURL; @@ -1360,7 +1360,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return sharingServices; } -#pragma mark NSMenuDelegate methods +// MARK: NSMenuDelegate methods - (void)menuWillOpen:(NSMenu *)menu { if (menu == self.mapViewContextMenu) { @@ -1369,7 +1369,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } } -#pragma mark NSSplitViewDelegate methods +// MARK: NSSplitViewDelegate methods - (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview { return subview != self.mapView; @@ -1379,7 +1379,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return YES; } -#pragma mark MGLMapViewDelegate methods +// MARK: MGLMapViewDelegate methods - (void)mapView:(MGLMapView *)mapView didFinishLoadingStyle:(MGLStyle *)style { [self updateLabels]; @@ -1439,7 +1439,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha return 0.8; } -#pragma mark MGLMapSnapshotterDelegate methods +// MARK: MGLMapSnapshotterDelegate methods - (void)mapSnapshotter:(MGLMapSnapshotter *)snapshotter didFinishLoadingStyle:(MGLStyle *)style { [style localizeLabelsIntoLocale:_isLocalizingLabels ? nil : [NSLocale localeWithLocaleIdentifier:@"mul"]]; @@ -1460,7 +1460,7 @@ NSArray> *MBXFlattenedShapes(NSArray> *sha } } -#pragma mark - MGLComputedShapeSourceDataSource +// MARK: - MGLComputedShapeSourceDataSource - (NSArray>*)featuresInCoordinateBounds:(MGLCoordinateBounds)bounds zoomLevel:(NSUInteger)zoom { double gridSpacing; if(zoom >= 13) { diff --git a/platform/ios/platform/macos/src/MGLAnnotationImage.h b/platform/ios/platform/macos/src/MGLAnnotationImage.h index d7336133d..a00301fa0 100644 --- a/platform/ios/platform/macos/src/MGLAnnotationImage.h +++ b/platform/ios/platform/macos/src/MGLAnnotationImage.h @@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN MGL_EXPORT @interface MGLAnnotationImage : NSObject -#pragma mark Initializing and Preparing the Image Object +// MARK: Initializing and Preparing the Image Object /** Initializes and returns a new annotation image object. @@ -26,7 +26,7 @@ MGL_EXPORT */ + (instancetype)annotationImageWithImage:(NSImage *)image reuseIdentifier:(NSString *)reuseIdentifier; -#pragma mark Getting and Setting Attributes +// MARK: Getting and Setting Attributes /** The image to display for the annotation. */ @property (nonatomic, readonly) NSImage *image; diff --git a/platform/ios/platform/macos/src/MGLMapView.h b/platform/ios/platform/macos/src/MGLMapView.h index 40deb4382..446334cc9 100644 --- a/platform/ios/platform/macos/src/MGLMapView.h +++ b/platform/ios/platform/macos/src/MGLMapView.h @@ -67,7 +67,7 @@ NS_ASSUME_NONNULL_BEGIN MGL_EXPORT IB_DESIGNABLE @interface MGLMapView : NSView -#pragma mark Creating Instances +// MARK: Creating Instances /** Initializes and returns a newly allocated map view with the specified frame and @@ -90,7 +90,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (instancetype)initWithFrame:(NSRect)frame styleURL:(nullable NSURL *)styleURL; -#pragma mark Accessing the Delegate +// MARK: Accessing the Delegate /** The receiver’s delegate. @@ -102,7 +102,7 @@ MGL_EXPORT IB_DESIGNABLE */ @property (nonatomic, weak, nullable) IBOutlet id delegate; -#pragma mark Configuring the Map’s Appearance +// MARK: Configuring the Map’s Appearance /** The style currently displayed in the receiver. @@ -199,7 +199,7 @@ MGL_EXPORT IB_DESIGNABLE @property (nonatomic, assign) BOOL prefetchesTiles; -#pragma mark Manipulating the Viewpoint +// MARK: Manipulating the Viewpoint /** The geographic coordinate at the center of the map view. @@ -691,7 +691,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (void)setContentInsets:(NSEdgeInsets)contentInsets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion; -#pragma mark Configuring How the User Interacts with the Map +// MARK: Configuring How the User Interacts with the Map /** A Boolean value that determines whether the user may zoom the map in and out, @@ -751,7 +751,7 @@ MGL_EXPORT IB_DESIGNABLE */ @property (nonatomic, getter=isPitchEnabled) BOOL pitchEnabled; -#pragma mark Annotating the Map +// MARK: Annotating the Map /** The complete list of annotations associated with the receiver. (read-only) @@ -853,7 +853,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (nullable NSArray> *)visibleAnnotationsInRect:(CGRect)rect; -#pragma mark Managing Annotation Selections +// MARK: Managing Annotation Selections /** The currently selected annotations. @@ -906,7 +906,7 @@ MGL_EXPORT IB_DESIGNABLE */ @property (nonatomic, strong, null_resettable) IBOutlet NSViewController *calloutViewController; -#pragma mark Finding Annotations +// MARK: Finding Annotations /** Returns a point annotation located at the given point. @@ -918,7 +918,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (id )annotationAtPoint:(NSPoint)point; -#pragma mark Overlaying the Map +// MARK: Overlaying the Map /** The complete list of overlays associated with the receiver. (read-only) @@ -969,7 +969,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (void)removeOverlays:(NSArray> *)overlays; -#pragma mark Accessing the Underlying Map Data +// MARK: Accessing the Underlying Map Data /** Returns an array of rendered map features that intersect with a given point. @@ -1164,7 +1164,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (NSArray> *)visibleFeaturesInRect:(NSRect)rect inStyleLayersWithIdentifiers:(nullable NSSet *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:)); -#pragma mark Converting Geographic Coordinates +// MARK: Converting Geographic Coordinates /** Converts a geographic coordinate to a point in the given view’s coordinate @@ -1234,7 +1234,7 @@ MGL_EXPORT IB_DESIGNABLE */ - (CLLocationDistance)metersPerPointAtLatitude:(CLLocationDegrees)latitude; -#pragma mark Debugging the Map +// MARK: Debugging the Map /** The options that determine which debugging aids are shown on the map. diff --git a/platform/ios/platform/macos/src/MGLMapView.mm b/platform/ios/platform/macos/src/MGLMapView.mm index fbc5a087d..bcf692b89 100644 --- a/platform/ios/platform/macos/src/MGLMapView.mm +++ b/platform/ios/platform/macos/src/MGLMapView.mm @@ -207,7 +207,7 @@ public: MGLReachability *_reachability; } -#pragma mark Lifecycle +// MARK: Lifecycle + (void)initialize { if (self == [MGLMapView class]) { @@ -628,7 +628,7 @@ public: #pragma clang diagnostic pop } -#pragma mark Style +// MARK: Style + (NSSet *)keyPathsForValuesAffectingStyle { return [NSSet setWithObject:@"styleURL"]; @@ -676,7 +676,7 @@ public: return _rendererFrontend->getRenderer(); } -#pragma mark View hierarchy and drawing +// MARK: View hierarchy and drawing - (void)viewWillMoveToWindow:(NSWindow *)newWindow { [self deselectAnnotation:self.selectedAnnotation]; @@ -995,7 +995,7 @@ public: return YES; } -#pragma mark Printing +// MARK: Printing - (void)print:(__unused id)sender { _isPrinting = YES; @@ -1010,7 +1010,7 @@ public: [op runOperation]; } -#pragma mark Viewport +// MARK: Viewport + (NSSet *)keyPathsForValuesAffectingCenterCoordinate { return [NSSet setWithObjects:@"latitude", @"longitude", @"camera", nil]; @@ -1489,7 +1489,7 @@ public: [self setCenterCoordinate:oldCenter animated:animated completionHandler:completion]; } -#pragma mark Mouse events and gestures +// MARK: Mouse events and gestures - (BOOL)acceptsFirstResponder { return YES; @@ -1767,7 +1767,7 @@ public: return nil; } -#pragma mark NSGestureRecognizerDelegate methods +// MARK: NSGestureRecognizerDelegate methods - (BOOL)gestureRecognizer:(NSGestureRecognizer *)gestureRecognizer shouldAttemptToRecognizeWithEvent:(NSEvent *)event { if (gestureRecognizer == _singleClickRecognizer) { if (!self.selectedAnnotation) { @@ -1781,7 +1781,7 @@ public: return YES; } -#pragma mark Keyboard events +// MARK: Keyboard events - (void)keyDown:(NSEvent *)event { // This is the recommended way to handle arrow key presses, causing @@ -1873,7 +1873,7 @@ public: _compass.hidden = !rotateEnabled; } -#pragma mark Ornaments +// MARK: Ornaments /// Updates the zoom controls’ enabled state based on the current zoom level. - (void)updateZoomControls { @@ -1892,7 +1892,7 @@ public: [self setDirection:-sender.doubleValue animated:YES]; } -#pragma mark Annotations +// MARK: Annotations - (nullable NSArray> *)annotations { if (_annotationContextsByAnnotationTag.empty()) { @@ -2658,7 +2658,7 @@ public: } } -#pragma mark MGLMultiPointDelegate methods +// MARK: MGLMultiPointDelegate methods - (double)alphaForShapeAnnotation:(MGLShape *)annotation { if (_delegateHasAlphasForShapeAnnotations) { @@ -2688,7 +2688,7 @@ public: return 3.0; } -#pragma mark MGLPopoverDelegate methods +// MARK: MGLPopoverDelegate methods - (void)popoverDidShow:(__unused NSNotification *)notification { id annotation = self.selectedAnnotation; @@ -2709,7 +2709,7 @@ public: } } -#pragma mark Overlays +// MARK: Overlays - (nonnull NSArray> *)overlays { @@ -2758,7 +2758,7 @@ public: [self removeAnnotations:overlays]; } -#pragma mark Tooltips and cursors +// MARK: Tooltips and cursors - (void)updateAnnotationTrackingAreas { if (_wantsToolTipRects) { @@ -2828,7 +2828,7 @@ public: } } -#pragma mark Data +// MARK: Data - (NSArray> *)visibleFeaturesAtPoint:(NSPoint)point { MGLLogDebug(@"Querying visibleFeaturesAtPoint: %@", NSStringFromPoint(point)); @@ -2901,13 +2901,13 @@ public: return MGLFeaturesFromMBGLFeatures(features); } -#pragma mark User interface validation +// MARK: User interface validation - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { return NO; } -#pragma mark Interface Builder methods +// MARK: Interface Builder methods - (void)prepareForInterfaceBuilder { [super prepareForInterfaceBuilder]; @@ -2929,7 +2929,7 @@ public: self.layer.contentsScale = [NSScreen mainScreen].backingScaleFactor; } -#pragma mark Geometric methods +// MARK: Geometric methods - (NSPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(nullable NSView *)view { if (!CLLocationCoordinate2DIsValid(coordinate)) { @@ -3024,7 +3024,7 @@ public: return mbgl::Projection::getMetersPerPixelAtLatitude(latitude, self.zoomLevel); } -#pragma mark Debugging +// MARK: Debugging - (MGLMapDebugMaskOptions)debugMask { mbgl::MapDebugOptions options = _mbglMap->getDebug(); diff --git a/platform/ios/platform/macos/src/MGLMapViewDelegate.h b/platform/ios/platform/macos/src/MGLMapViewDelegate.h index 098164cd7..dc17bec90 100644 --- a/platform/ios/platform/macos/src/MGLMapViewDelegate.h +++ b/platform/ios/platform/macos/src/MGLMapViewDelegate.h @@ -21,7 +21,7 @@ NS_ASSUME_NONNULL_BEGIN @optional -#pragma mark Responding to Map Viewpoint Changes +// MARK: Responding to Map Viewpoint Changes /** Tells the delegate that the viewpoint depicted by the map view is about to @@ -87,7 +87,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)mapView:(MGLMapView *)mapView shouldChangeFromCamera:(MGLMapCamera *)oldCamera toCamera:(MGLMapCamera *)newCamera; -#pragma mark Loading the Map +// MARK: Loading the Map /** Tells the delegate that the map view will begin to load. @@ -197,7 +197,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)mapView:(MGLMapView *)mapView shouldRemoveStyleImage:(NSString *)imageName; -#pragma mark Managing the Appearance of Annotations +// MARK: Managing the Appearance of Annotations /** Returns an annotation image object to mark the given point annotation object on @@ -270,7 +270,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (CGFloat)mapView:(MGLMapView *)mapView lineWidthForPolylineAnnotation:(MGLPolyline *)annotation; -#pragma mark Selecting Annotations +// MARK: Selecting Annotations /** Returns a Boolean value indicating whether the shape annotation can be selected. @@ -304,7 +304,7 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)mapView:(MGLMapView *)mapView didDeselectAnnotation:(id )annotation; -#pragma mark Managing Callout Popovers +// MARK: Managing Callout Popovers /** Returns a Boolean value indicating whether the annotation is able to display diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index 4091fbafc..d520c9078 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -80,7 +80,7 @@ void Map::triggerRepaint() { impl->onUpdate(); } -#pragma mark - Style +// MARK: - Style style::Style& Map::getStyle() { return *impl->style; @@ -99,7 +99,7 @@ void Map::setStyle(std::unique_ptr