Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Commit eb8b80d

Browse files
committed
[ios] Generate API documentation using jazzy
Replaced appledoc usage with jazzy, which understands modern Objective-C syntax by virtue of using Clang ASTs. Nevertheless, we have to make lots of changes to our documentation syntax, which was tailored to appledocs quirks. The new syntax jives much better with what Xcode expects in terms of auto-indentation and Quick Help. Fixes #1420.
1 parent 7c22792 commit eb8b80d

15 files changed

+747
-525
lines changed

docs/BUILD_IOS_OSX.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@ This section is for people contributing to Mapbox GL directly in the context of
44

55
### Build
66

7-
1. Install [appledoc](http://appledoc.gentlebytes.com/appledoc/) for API docs generation.
7+
1. Install [jazzy](https://github.com/realm/jazzy) for generating API documentation:
88

99
```
10-
curl -L -o appledoc.zip https://github.com/tomaz/appledoc/releases/download/v2.2-963/appledoc.zip
11-
unzip appledoc.zip
12-
cp appledoc /usr/local/bin
13-
cp -Rf Templates/ ~/.appledoc
10+
[sudo] gem install jazzy
1411
```
1512

1613
1. Run `make ipackage`. The packaging script will produce the statically-linked `libMapbox.a`, `Mapbox.bundle` for resources, a `Headers` folder, and a `Docs` folder with HTML API documentation.

include/mbgl/darwin/MGLAnnotation.h

+17-11
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,34 @@
66

77
NS_ASSUME_NONNULL_BEGIN
88

9-
/** The `MGLAnnotation` protocol is used to provide annotation-related information to a map view. To use this protocol, you adopt it in any custom objects that store or represent annotation data. Each object then serves as the source of information about a single map annotation and provides critical information, such as the annotation’s location on the map. Annotation objects do not provide the visual representation of the annotation but typically coordinate (in conjunction with the map view’s delegate) the creation of an appropriate objects to handle the display.
10-
*
11-
* An object that adopts this protocol must implement the `coordinate` property. The other methods of this protocol are optional. */
9+
/**
10+
The `MGLAnnotation` protocol is used to provide annotation-related information to a map view. To use this protocol, you adopt it in any custom objects that store or represent annotation data. Each object then serves as the source of information about a single map annotation and provides critical information, such as the annotation’s location on the map. Annotation objects do not provide the visual representation of the annotation but typically coordinate (in conjunction with the map view’s delegate) the creation of an appropriate objects to handle the display.
11+
12+
An object that adopts this protocol must implement the `coordinate` property. The other methods of this protocol are optional.
13+
*/
1214
@protocol MGLAnnotation <NSObject>
1315

14-
/** @name Position Attributes */
16+
#pragma mark Position Attributes
1517

1618
/** The center point (specified as a map coordinate) of the annotation. (required) (read-only) */
1719
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
1820

1921
@optional
2022

21-
/** @name Title Attributes */
23+
#pragma mark Title Attributes
2224

23-
/** The string containing the annotation’s title.
24-
*
25-
* Although this property is optional, if you support the selection of annotations in your map view, you are expected to provide this property. This string is displayed in the callout for the associated annotation. */
25+
/**
26+
The string containing the annotation’s title.
27+
28+
Although this property is optional, if you support the selection of annotations in your map view, you are expected to provide this property. This string is displayed in the callout for the associated annotation.
29+
*/
2630
@property (nonatomic, readonly, copy, nullable) NSString *title;
2731

28-
/** The string containing the annotation’s subtitle.
29-
*
30-
* This string is displayed in the callout for the associated annotation. */
32+
/**
33+
The string containing the annotation’s subtitle.
34+
35+
This string is displayed in the callout for the associated annotation.
36+
*/
3137
@property (nonatomic, readonly, copy, nullable) NSString *subtitle;
3238

3339
#if !TARGET_OS_IPHONE

include/mbgl/darwin/MGLGeometry.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ NS_INLINE MGLCoordinateBounds MGLCoordinateBoundsOffset(MGLCoordinateBounds boun
6868
}
6969

7070
/** Returns `YES` if the coordinate bounds covers no area.
71-
*
72-
* Note that a bounds may be empty but have a non-zero coordinate span (e.g., when its northeast point lies due north of its southwest point). */
71+
72+
Note that a bounds may be empty but have a non-zero coordinate span (e.g., when its northeast point lies due north of its southwest point). */
7373
NS_INLINE BOOL MGLCoordinateBoundsIsEmpty(MGLCoordinateBounds bounds) {
7474
MGLCoordinateSpan span = MGLCoordinateBoundsGetCoordinateSpan(bounds);
7575
return span.latitudeDelta == 0 || span.longitudeDelta == 0;

include/mbgl/darwin/MGLMapCamera.h

+15
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,25 @@ NS_ASSUME_NONNULL_BEGIN
2424
/** Returns a new camera with all properties set to 0. */
2525
+ (instancetype)camera;
2626

27+
/**
28+
Returns a new camera using based on information about the camera’s viewpoint and focus point.
29+
30+
@param centerCoordinate The geographic coordinate on which the map should be centered.
31+
@param eyeCoordinate The geometric coordinate at which the camera should be situated.
32+
@param eyeAltitude The altitude (measured in meters) above the map at which the camera should be situated. The altitude may be less than the distance from the camera’s viewpoint to the camera’s focus point.
33+
*/
2734
+ (instancetype)cameraLookingAtCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
2835
fromEyeCoordinate:(CLLocationCoordinate2D)eyeCoordinate
2936
eyeAltitude:(CLLocationDistance)eyeAltitude;
3037

38+
/**
39+
Returns a new camera with the given distance, pitch, and heading.
40+
41+
@param centerCoordinate The geographic coordinate on which the map should be centered.
42+
@param distance The straight-line distance from the viewpoint to the `centerCoordinate`.
43+
@param pitch The viewing angle of the camera, measured in degrees. A value of `0` results in a camera pointed straight down at the map. Angles greater than `0` result in a camera angled toward the horizon.
44+
@param heading The camera’s heading, measured in degrees clockwise from true north. A value of `0` means that the top edge of the map view corresponds to true north. The value `90` means the top of the map is pointing due east. The value `180` means the top of the map points due south, and so on.
45+
*/
3146
+ (instancetype)cameraLookingAtCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
3247
fromDistance:(CLLocationDistance)distance
3348
pitch:(CGFloat)pitch

include/mbgl/darwin/MGLMultiPoint.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ NS_ASSUME_NONNULL_BEGIN
1313
/** The number of points associated with the shape. (read-only) */
1414
@property (nonatomic, readonly) NSUInteger pointCount;
1515

16-
/** Retrieves one or more coordinates associated with the shape.
17-
* @param coords On input, you must provide a C array of structures large enough to hold the desired number of coordinates. On output, this structure contains the requested coordinate data.
18-
* @param range The range of points you want. The `location` field indicates the first point you are requesting, with `0` being the first point, `1` being the second point, and so on. The `length` field indicates the number of points you want. The array in _`coords`_ must be large enough to accommodate the number of requested coordinates. */
16+
/**
17+
Retrieves one or more coordinates associated with the shape.
18+
19+
@param coords On input, you must provide a C array of structures large enough to hold the desired number of coordinates. On output, this structure contains the requested coordinate data.
20+
@param range The range of points you want. The `location` field indicates the first point you are requesting, with `0` being the first point, `1` being the second point, and so on. The `length` field indicates the number of points you want. The array in _`coords`_ must be large enough to accommodate the number of requested coordinates.
21+
*/
1922
- (void)getCoordinates:(CLLocationCoordinate2D *)coords range:(NSRange)range;
2023

2124
@end

include/mbgl/darwin/MGLOverlay.h

+25-16
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,37 @@
88

99
NS_ASSUME_NONNULL_BEGIN
1010

11-
/** The `MGLOverlay` protocol defines a specific type of annotation that represents both a point and an area on a map. Overlay objects are essentially data objects that contain the geographic data needed to represent the map area. For example, overlays can take the form of common shapes such as rectangles and circles. They can also describe polygons and other complex shapes.
12-
*
13-
* You use overlays to layer more sophisticated content on top of a map view. For example, you could use an overlay to show the boundaries of a national park or trace a bus route along city streets. The Mapbox iOS SDK defines several concrete classes that conform to this protocol and define standard shapes.
14-
*
15-
* Because overlays are also annotations, they have similar usage pattern to annotations. When added to a map view using the `addOverlay:` method, that view detects whenever the overlay’s defined region intersects the visible portion of the map. At that point, the map view asks its delegate to provide a special overlay view to draw the visual representation of the overlay. If you add an overlay to a map view as an annotation instead, it is treated as an annotation with a single point. */
11+
/**
12+
The `MGLOverlay` protocol defines a specific type of annotation that represents both a point and an area on a map. Overlay objects are essentially data objects that contain the geographic data needed to represent the map area. For example, overlays can take the form of common shapes such as rectangles and circles. They can also describe polygons and other complex shapes.
13+
14+
You use overlays to layer more sophisticated content on top of a map view. For example, you could use an overlay to show the boundaries of a national park or trace a bus route along city streets. The Mapbox iOS SDK defines several concrete classes that conform to this protocol and define standard shapes.
15+
16+
Because overlays are also annotations, they have similar usage pattern to annotations. When added to a map view using the `addOverlay:` method, that view detects whenever the overlay’s defined region intersects the visible portion of the map. At that point, the map view asks its delegate to provide a special overlay view to draw the visual representation of the overlay. If you add an overlay to a map view as an annotation instead, it is treated as an annotation with a single point.
17+
*/
1618
@protocol MGLOverlay <MGLAnnotation>
1719

18-
/* The approximate center point of the overlay area. (required) (read-only)
19-
*
20-
* This point is typically set to the center point of the map’s bounding rectangle. It is used as the anchor point for any callouts displayed for the annotation. */
20+
/**
21+
The approximate center point of the overlay area. (required) (read-only)
22+
23+
This point is typically set to the center point of the map’s bounding rectangle. It is used as the anchor point for any callouts displayed for the annotation.
24+
*/
2125
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
2226

23-
/** The cooordinate rectangle that encompasses the overlay. (required) (read-only)
24-
*
25-
* This property contains the smallest rectangle that completely encompasses the overlay. Implementers of this protocol must set this area when implementing their overlay class, and after setting it, you must not change it. */
27+
/**
28+
The cooordinate rectangle that encompasses the overlay. (required) (read-only)
29+
30+
This property contains the smallest rectangle that completely encompasses the overlay. Implementers of this protocol must set this area when implementing their overlay class, and after setting it, you must not change it.
31+
*/
2632
@property (nonatomic, readonly) MGLCoordinateBounds overlayBounds;
2733

28-
/** Returns a Boolean indicating whether the specified rectangle intersects the receiver’s shape.
29-
*
30-
* You can implement this method to provide more specific bounds checking for an overlay. If you do not implement it, the bounding rectangle is used to detect intersections.
31-
* @param overlayBounds The rectangle to intersect with the receiver’s area.
32-
* @return `YES` if any part of the map rectangle intersects the receiver’s shape or `NO` if it does not. */
34+
/**
35+
Returns a Boolean indicating whether the specified rectangle intersects the receiver’s shape.
36+
37+
You can implement this method to provide more specific bounds checking for an overlay. If you do not implement it, the bounding rectangle is used to detect intersections.
38+
39+
@param overlayBounds The rectangle to intersect with the receiver’s area.
40+
@return `YES` if any part of the map rectangle intersects the receiver’s shape or `NO` if it does not.
41+
*/
3342
- (BOOL)intersectsOverlayBounds:(MGLCoordinateBounds)overlayBounds;
3443

3544
@end

include/mbgl/darwin/MGLPolygon.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ NS_ASSUME_NONNULL_BEGIN
1111
/** The `MGLPolygon` class represents a shape consisting of one or more points that define a closed polygon. The points are connected end-to-end in the order they are provided. The first and last points are connected to each other to create the closed shape. */
1212
@interface MGLPolygon : MGLMultiPoint <MGLOverlay>
1313

14-
/** Creates and returns an `MGLPolygon` object from the specified set of coordinates.
15-
* @param coords The array of coordinates defining the shape. The data in this array is copied to the new object.
16-
* @param count The number of items in the _`coords`_ array.
17-
* @return A new polygon object. */
14+
/**
15+
Creates and returns an `MGLPolygon` object from the specified set of coordinates.
16+
17+
@param coords The array of coordinates defining the shape. The data in this array is copied to the new object.
18+
@param count The number of items in the `coords` array.
19+
@return A new polygon object.
20+
*/
1821
+ (instancetype)polygonWithCoordinates:(CLLocationCoordinate2D *)coords
1922
count:(NSUInteger)count;
2023

include/mbgl/darwin/MGLPolyline.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ NS_ASSUME_NONNULL_BEGIN
1111
/** The `MGLPolyline` class represents a shape consisting of one or more points that define connecting line segments. The points are connected end-to-end in the order they are provided. The first and last points are not connected to each other. */
1212
@interface MGLPolyline : MGLMultiPoint <MGLOverlay>
1313

14-
/** Creates and returns an `MGLPolyline` object from the specified set of coordinates.
15-
* @param coords The array of coordinates defining the shape. The data in this array is copied to the new object.
16-
* @param count The number of items in the _`coords`_ array.
17-
* @return A new polyline object. */
14+
/**
15+
Creates and returns an `MGLPolyline` object from the specified set of coordinates.
16+
17+
@param coords The array of coordinates defining the shape. The data in this array is copied to the new object.
18+
@param count The number of items in the `coords` array.
19+
@return A new polyline object.
20+
*/
1821
+ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords
1922
count:(NSUInteger)count;
2023

include/mbgl/darwin/MGLStyle.h

+30-12
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,46 @@ NS_ASSUME_NONNULL_BEGIN
77
/** A collection of convenience methods for creating style URLs of default styles provided by Mapbox. These instances of NSURL are cached. */
88
@interface MGLStyle : NSObject
99

10-
/** Returns the Streets style URL.
11-
* Mapbox Streets is a complete base map, perfect for incorporating your own data. */
10+
/**
11+
Returns the Streets style URL.
12+
13+
Mapbox Streets is a complete base map, perfect for incorporating your own data.
14+
*/
1215
+ (NSURL *)streetsStyleURL;
1316

14-
/** Returns the Emerald style URL.
15-
* Emerald is a versatile style with emphasis on road networks and public transportation. */
17+
/**
18+
Returns the Emerald style URL.
19+
20+
Emerald is a versatile style with emphasis on road networks and public transportation.
21+
*/
1622
+ (NSURL *)emeraldStyleURL;
1723

18-
/** Returns the Light style URL.
19-
* Light is a subtle, light-colored backdrop for data visualizations. */
24+
/**
25+
Returns the Light style URL.
26+
27+
Light is a subtle, light-colored backdrop for data visualizations.
28+
*/
2029
+ (NSURL *)lightStyleURL;
2130

22-
/** Returns the Dark style URL.
23-
* Dark is a subtle, dark-colored backdrop for data visualizations. */
31+
/**
32+
Returns the Dark style URL.
33+
34+
Dark is a subtle, dark-colored backdrop for data visualizations.
35+
*/
2436
+ (NSURL *)darkStyleURL;
2537

26-
/** Returns the Satellite style URL.
27-
* Mapbox Satellite is a beautiful global satellite and aerial imagery layer. */
38+
/**
39+
Returns the Satellite style URL.
40+
41+
Mapbox Satellite is a beautiful global satellite and aerial imagery layer.
42+
*/
2843
+ (NSURL *)satelliteStyleURL;
2944

30-
/** Returns the Hybrid style URL.
31-
* Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels. */
45+
/**
46+
Returns the Hybrid style URL.
47+
48+
Hybrid combines the global satellite and aerial imagery of Mapbox Satellite with unobtrusive labels.
49+
*/
3250
+ (NSURL *)hybridStyleURL;
3351

3452
- (instancetype)init NS_UNAVAILABLE;

include/mbgl/ios/MGLAccountManager.h

+19-12
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,30 @@ NS_ASSUME_NONNULL_BEGIN
77
/** The MGLAccountManager object provides a global way to set a Mapbox API access token, as well as other settings used framework-wide. */
88
@interface MGLAccountManager : NSObject
99

10-
/** @name Authorizing Access */
11-
12-
/** Set the Mapbox API access token for the framework.
13-
*
14-
* You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
15-
* @param accessToken The Mapbox API access token. */
10+
#pragma mark Authorizing Access
11+
12+
/**
13+
Set the Mapbox API access token for the framework.
14+
15+
You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
16+
@param accessToken The Mapbox API access token.
17+
*/
1618
+ (void)setAccessToken:(nullable NSString *)accessToken;
1719

18-
/** Retreive the Mapbox API access token for the framework.
19-
*
20-
* You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
21-
* @return accessToken The Mapbox API access token. */
20+
/**
21+
Retreive the Mapbox API access token for the framework.
22+
23+
You can set an access token on MGLAccountManager or on an individual map view. The same token is used throughout the framework.
24+
25+
@return accessToken The Mapbox API access token.
26+
*/
2227
+ (nullable NSString *)accessToken;
2328

24-
/** @name Providing User Metrics Opt-Out */
29+
#pragma mark Providing User Metrics Opt-Out
2530

26-
/** Whether in-app user metrics opt-out is configured. If set to the default value of `NO`, a user opt-out preference is expected in a `Settings.bundle` that shows in the application's section within the system Settings app. */
31+
/**
32+
Whether in-app user metrics opt-out is configured. If set to the default value of `NO`, a user opt-out preference is expected in a `Settings.bundle` that shows in the application's section within the system Settings app.
33+
*/
2734
+ (BOOL)mapboxMetricsEnabledSettingShownInApp;
2835

2936
@end

0 commit comments

Comments
 (0)