Skip to content

Commit

Permalink
Adopt project for Xcode 16 beta (#2180)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksproger committed Jun 11, 2024
1 parent bd22eec commit e8e6d34
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 57 deletions.
8 changes: 5 additions & 3 deletions Sources/MapboxMaps/Annotations/AnnotationOrchestrator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ public final class AnnotationOrchestrator {
/// `removeAnnotationManager(withId:)` had been called. `AnnotationOrchestrator`
/// keeps a strong reference to any `PointAnnotationManager` until it is removed.
/// - Parameters:
/// - id: Optional string identifier for this manager.
/// - layerPosition: Optionally set the `LayerPosition` of the layer managed.
/// - clusterOptions: Optionally set the `ClusterOptions` to cluster the Point Annotations
/// - id: Optional string identifier for this manager.
/// - layerPosition: Optionally set the `LayerPosition` of the layer managed.
/// - clusterOptions: Optionally set the `ClusterOptions` to cluster the Point Annotations
/// - onClusterTap: Closure that will be executed after the long press gesture processsed.
/// - onClusterLongPress: Closure that will be executed after the tap gesture will be processed on the map
/// - Returns: An instance of `PointAnnotationManager`
public func makePointAnnotationManager(
id: String = String(UUID().uuidString.prefix(5)),
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sources/MapboxMaps/Annotations/ViewAnnotation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public final class ViewAnnotation {
/// - Parameters:
/// - layerId: Layer identifier which renders the feature.
/// - featureId: Feature identifier. If not specified, the annotation will appear on any feature from that layer.
/// - content: The view to place on the map.
/// - view: The view to place on the map.
public convenience init(layerId: String, featureId: String? = nil, view: UIView) {
self.init(
annotatedFeature: .layerFeature(layerId: layerId, featureId: featureId),
Expand Down
10 changes: 6 additions & 4 deletions Sources/MapboxMaps/Annotations/ViewAnnotationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public protocol ViewAnnotationUpdateObserver: AnyObject {
///
/// Use `isHidden` property to determine whether a view is visible or not.
/// - Parameters:
/// - annotationsViews: The annotation vies whose visibility changed.
/// - annotationViews: The annotation vies whose visibility changed.
func visibilityDidChange(for annotationViews: [UIView])
}

Expand Down Expand Up @@ -81,9 +81,10 @@ public final class ViewAnnotationManager {
/// The complete list of annotations associated with the receiver.
@available(*, deprecated, renamed: "allAnnotations", message: "Please use allAnnotations instead, or directly access ViewAnnotation itself")
public var annotations: [UIView: ViewAnnotationOptions] {
idsByView.compactMapValues { [mapboxMap] id in
let values = idsByView.compactMapValues { [mapboxMap] id in
try? mapboxMap.options(forViewAnnotationWithId: id)
}
return values
}

internal init(containerView: UIView, mapboxMap: MapboxMapProtocol, displayLink: Signal<Void>) {
Expand Down Expand Up @@ -320,7 +321,7 @@ public final class ViewAnnotationManager {
/// If an annotation has multiple ``ViewAnnotation/variableAnchors``, the last picked anchor configuration
/// will we used for bounding box calculation. If annotation is not yet rendered, the first first confit from the list will be used.
///
/// - Parameter ids: The list of annotations ids to be framed.
/// - Parameter annotations: The list of annotations ids to be framed.
/// - Parameter padding: See ``CameraOptions-swift.struct/padding``.
/// - Parameter bearing: See ``CameraOptions-swift.struct/bearing``.
/// - Parameter pitch: See ``CameraOptions-swift.struct/pitch``.
Expand Down Expand Up @@ -348,7 +349,7 @@ public final class ViewAnnotationManager {
///
/// - Important: This API isn't supported by Globe projection.
///
/// - Parameter ids: The list of annotations ids to be framed.
/// - Parameter identifiers: The list of annotations ids to be framed.
/// - Parameter padding: See ``CameraOptions-swift.struct/padding``.
/// - Parameter bearing: See ``CameraOptions-swift.struct/bearing``.
/// - Parameter pitch: See ``CameraOptions-swift.struct/pitch``.
Expand All @@ -359,6 +360,7 @@ public final class ViewAnnotationManager {
bearing: CGFloat? = nil,
pitch: CGFloat? = nil
) -> CameraOptions? {

let corners: [CoordinateBoundsCorner] = identifiers.compactMap {
guard
let options = try? mapboxMap.options(forViewAnnotationWithId: $0),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Annotations
# Layer Annotations

## Topics


### Annotations

- ``AnnotationOrchestrator``
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sources
# Sources

## Topics

Expand Down
8 changes: 2 additions & 6 deletions Sources/MapboxMaps/Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ The Mapbox Maps SDK for iOS is a public library for displaying interactive, thor
- <doc:Snapshotter-APIs>
- <doc:Events>

### Style

### Styling
- <doc:Style>
- <doc:Layers>
- <doc:Sources>
Expand All @@ -27,12 +26,10 @@ The Mapbox Maps SDK for iOS is a public library for displaying interactive, thor
- <doc:Declarative-Map-Styling>

### Annotations

- <doc:Annotations>
- <doc:Layer-Annotations>
- <doc:View-Annotations>

### Advanced

- <doc:Performance>
- <doc:TileStore-APIs>
- <doc:MapboxMap-APIs>
Expand All @@ -45,7 +42,6 @@ The Mapbox Maps SDK for iOS is a public library for displaying interactive, thor
- <doc:Settings-and-Constants>

### Dependencies

- <doc:CoreMaps>
- <doc:Common>
- <doc:Turf>
Expand Down
2 changes: 1 addition & 1 deletion Sources/MapboxMaps/Foundation/AnyCancelable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class AnyCancelable: Cancelable {
/// Creates AnyCancelable with the canceler object.
///
/// - Parameters:
/// - closure: The `Cancelable` token to be cancelled.
/// - canceler: The `Cancelable` token to be cancelled.
public convenience init<C: Cancelable>(_ canceler: C) {
self.init(canceler.cancel)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import MapboxCoreMaps

/// Specifies the position at which a layer will be added when using
/// `Style.addLayer`.
/// Specifies the position at which a layer will be added when using `Style.addLayer`.
public enum LayerPosition: Equatable, Codable {
/// Default behavior; add to the top of the layers stack.
case `default`
Expand Down
1 change: 1 addition & 0 deletions Sources/MapboxMaps/Foundation/MapInitOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public final class MapInitOptions: NSObject {
/// - styleURI: Style URI for the map to load. Defaults to `.streets`, but
/// can be `nil`.
/// - styleJSON: Style JSON in String representation. Has precedence over ``styleURI``.
/// - antialiasingSampleCount: Sample count to control multisample anti-aliasing (MSAA) option for rendering.
public init(
mapOptions: MapOptions = MapOptions(),
cameraOptions: CameraOptions? = nil,
Expand Down
10 changes: 5 additions & 5 deletions Sources/MapboxMaps/Foundation/MapboxMap.swift
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public final class MapboxMap: StyleManager {
///
/// This API isn't supported by Globe projection.
///
/// - Parameter point: The point to convert. Must exist in the coordinate space
/// - Parameter points: The points to convert. Must exist in the coordinate space
/// of the `MapView`
/// - Returns: A `CLLocationCoordinate` that represents the geographic location
/// of the point.
Expand Down Expand Up @@ -892,8 +892,8 @@ public final class MapboxMap: StyleManager {
/// should be called after `beginGesture` and before `endGesture`.
///
/// - Parameters:
/// - fromPoint: The point from which the map is dragged.
/// - toPoint: The point to which the map is dragged.
/// - from: The point from which the map is dragged.
/// - to: The point to which the map is dragged.
///
/// - Returns:
/// The camera options object showing end point.
Expand Down Expand Up @@ -1245,7 +1245,7 @@ extension MapboxMap {
/// the returned `Cancelable` object.
///
/// - Parameters:
/// - eventType: The event type to listen to.
/// - event: The event type to listen to.
/// - handler: The closure to execute when the event occurs.
///
/// - Returns: A `Cancelable` object that you can use to stop listening for
Expand All @@ -1260,7 +1260,7 @@ extension MapboxMap {
/// Listen to multiple occurrences of a Map event.
///
/// - Parameters:
/// - eventType: The event type to listen to.
/// - event: The event type to listen to.
/// - handler: The closure to execute when the event occurs.
///
/// - Returns: A `Cancelable` object that you can use to stop listening for
Expand Down
2 changes: 1 addition & 1 deletion Sources/MapboxMaps/Foundation/Signal/Signal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension Signal {
/// - Note: The created signal is analogous to the `Combine.Just`.
///
/// - Parameters:
/// - just: A payload.
/// - constant: A payload.
public init(just constant: Payload) {
self.init { handler in
handler(constant)
Expand Down
3 changes: 3 additions & 0 deletions Sources/MapboxMaps/Location/Puck/PuckType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public struct Puck2DConfiguration: Equatable {
/// - bearingImage: The image used as the middle of the location indicator.
/// - shadowImage: The image that acts as a background of the location indicator.
/// - scale: The size of the images, as a scale factor applied to the size of the specified image.
/// - pulsing: The configuration parameters for sonar-like pulsing circle animation shown around the 2D puck.
/// - showsAccuracyRing: Indicates whether the location accurary ring should be shown.
/// - opacity: The opacity of the entire location indicator.
public init(
Expand Down Expand Up @@ -119,6 +120,7 @@ public struct Puck2DConfiguration: Equatable {
/// - accuracyRingColor:The color of the accuracy ring.
/// - accuracyRingBorderColor: The color of the accuracy ring border.
/// - opacity: The opacity of the entire location indicator.
/// - layerPosition: Specifies the position at which a layer will be added.
public init(
topImage: UIImage? = nil,
bearingImage: UIImage? = nil,
Expand Down Expand Up @@ -224,6 +226,7 @@ public struct Puck3DConfiguration: Equatable {
/// - modelOpacity: The opacity of the model used as the location puck
/// - modelCastShadows: Enable/disable shadow casting for the puck model
/// - modelReceiveShadows: Enable/disable shadow receiving for the puck model
/// - modelScaleMode: Defines scaling mode. Only applies to location-indicator type layers.
/// - modelEmissiveStrength: Strength of the light emission.
/// - layerPosition: Defines relative position of the puck layer.
@_documentation(visibility: public)
Expand Down
18 changes: 8 additions & 10 deletions Sources/MapboxMaps/Offline/TileRegionLoadOptions+MapboxMaps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@ extension TileRegionLoadOptions {
/// - descriptors: The tile region's tileset descriptors. If presented, will update the region
/// with new descriptor.
/// - metadata: A custom JSON value to be associated with this tile region.
/// - tileLoadOptions: Restrict the tile region load request to the
/// - extraOptions: Restrict the tile region load request to the
/// specified network types. If none of the specified network types
/// is available, the load request fails with an error.
/// is available, the load request fails with an error. Must be a valid JSON object.
/// - acceptExpired: is not a strict bandwidth limit, but only
/// limits the average download speed. Tile regions may be temporarily
/// downloaded with higher speed, then downloading will pause until the rolling
/// average has dropped below this value.
/// - networkRestriction: Classify network types based on cost.
/// - averageBytesPerSecond: Limits the download speed of the tile region.
/// - extraOptions: Extra tile region load options. Must be a valid JSON object.
///
/// `averageBytesPerSecond` is not a strict bandwidth limit, but only
/// limits the average download speed. Tile regions may be temporarily
/// downloaded with higher speed, then downloading will pause until the rolling
/// average has dropped below this value.
///
/// If `metadata` is not a valid JSON object, then this initializer returns
/// `nil`.
/// - Note: If `metadata` is not a valid JSON object, then this initializer returns `nil`.
public convenience init?(
geometry: Geometry?,
descriptors: [TilesetDescriptor]? = nil,
Expand Down
2 changes: 1 addition & 1 deletion Sources/MapboxMaps/Offline/TileStore+MapboxMaps.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ extension TileStore: TileStoreProtocol {
/// On successful tile region removal, the given callback is invoked with the removed tile region.
/// Otherwise, the given callback is invoked with an error.
/// - Parameter id: The tile region identifier.
/// - Parameter callback A callback to be invoked when a tile region was removed.
/// - Parameter completion: A callback to be invoked when a tile region was removed.
public func removeRegion(forId id: String, completion: @escaping (Result<TileRegion, Error>) -> Void) {
__removeTileRegion(forId: id, callback: tileStoreClosureAdapter(for: completion, type: TileRegion.self))
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/MapboxMaps/Snapshot/Snapshotter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ extension Snapshotter {
/// the returned `Cancelable` object.
///
/// - Parameters:
/// - eventType: The event type to listen to.
/// - event: The event type to listen to.
/// - handler: The closure to execute when the event occurs.
///
/// - Returns: A `Cancelable` object that you can use to stop listening for
Expand All @@ -375,7 +375,7 @@ extension Snapshotter {
/// Listen to multiple occurrences of a Map event.
///
/// - Parameters:
/// - eventType: The event type to listen to.
/// - event: The event type to listen to.
/// - handler: The closure to execute when the event occurs.
///
/// - Returns: A `Cancelable` object that you can use to stop listening for
Expand Down
15 changes: 7 additions & 8 deletions Sources/MapboxMaps/Style/StyleManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ public class StyleManager {
This function is useful if you do not know the concrete type of the layer
you are fetching, or don't need to know for your situation.
- Parameter layerID: The id of the layer to be fetched
- Parameter id: The id of the layer to be fetched
- Returns: The fully formed `layer` object.
- Throws: Type conversion errors
*/
Expand Down Expand Up @@ -238,7 +237,6 @@ public class StyleManager {
/**
Adds a `source` to the map
- Parameter source: The source to add to the map.
- Parameter identifier: A unique source identifier.
- Parameter dataId: An optional data ID to filter ``MapboxMap/onSourceDataLoaded`` to only the specified data source. Applies only to ``GeoJSONSource``s.
- Throws: ``StyleError`` if there is a problem adding the `source`.
Expand Down Expand Up @@ -665,8 +663,8 @@ public class StyleManager {
/// Moves a style layer with given `layerId` to the new position.
///
/// - Parameters:
/// - layerId: Style layer id
/// - layerPosition: Position to move the layer in the stack of layers on the map. Defaults to the top layer.
/// - id: Style layer id
/// - position: Position to move the layer in the stack of layers on the map. Defaults to the top layer.
///
/// - Throws:
/// `StyleError` on failure, or `NSError` with a _domain of "com.mapbox.bindgen"
Expand Down Expand Up @@ -1135,15 +1133,15 @@ public class StyleManager {

/// Gets the value of a style light property.
///
/// - Parameter light: The unique identifier of the style light in lights list.
/// - Parameter lightId: The unique identifier of the style light in lights list.
/// - Parameter property: The style light property name.
public func lightProperty(for lightId: String, property: String) -> Any {
styleManager.getStyleLightProperty(forId: lightId, property: property).value
}

/// Gets the value of a style light property.
///
/// - Parameter light: The unique identifier of the style light in lights list.
/// - Parameter lightId: The unique identifier of the style light in lights list.
/// - Parameter property: The style light property name.
public func lightPropertyValue(for lightId: String, property: String) -> StylePropertyValue {
styleManager.getStyleLightProperty(forId: lightId, property: property)
Expand All @@ -1165,7 +1163,7 @@ public class StyleManager {

/// Sets the value of a style light property in lights list.
///
/// - Parameter id: The unique identifier of the style light in lights list.
/// - Parameter lightId: The unique identifier of the style light in lights list.
/// - Parameter property: The style light property name.
/// - Parameter value: The style light property value.
/// - throws: An error describing why the operation is unsuccessful.
Expand Down Expand Up @@ -1282,6 +1280,7 @@ public class StyleManager {
/// - See Also [style-spec/fog](https://docs.mapbox.com/mapbox-gl-js/style-spec/fog/)
///
/// - Parameter property: Style atmosphere property name.
/// - Parameter value: Style atmosphere property value.
///
/// - Throws:
/// An error describing why the operation was unsuccessful.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sources/MapboxMaps/SwiftUI/Map+Gestures.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public struct MapGestureHandlers {
/// - Parameters:
/// - onBegin: Called when a gesture has begun.
/// - onEnd: Called when a gesture has ended. The second argument informs whether there will be a deceleration animation. Use `onAnimationEnd` to handle the animation end.
/// - onAnimationEnd: Called when deceleration animation triggered due to a gesture has ended.
/// - onEndAnimation: Called when deceleration animation triggered due to a gesture has ended.
@_documentation(visibility: public)
public init(
onBegin: ((GestureType) -> Void)? = nil,
Expand Down

0 comments on commit e8e6d34

Please sign in to comment.