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

CLLocationCoordinate2D array parameters should be constant #7214

Closed
8 tasks done
1ec5 opened this issue Nov 29, 2016 · 0 comments
Closed
8 tasks done

CLLocationCoordinate2D array parameters should be constant #7214

1ec5 opened this issue Nov 29, 2016 · 0 comments
Assignees
Labels
annotations Annotations on iOS and macOS or markers on Android iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS MapKit parity For feature parity with MapKit on iOS or macOS
Milestone

Comments

@1ec5
Copy link
Contributor

1ec5 commented Nov 29, 2016

Various geometry classes like MGLPolyline have methods that take C arrays of CLLocationCoordinate2Ds. In iOS 10.0, the analogous parameters in MapKit have changed to be const, because constant C arrays have more convenient bridging in Swift 3 – UnsafePointer<CLLocationCoordinate2D> instead of UnsafeMutablePointer<CLLocationCoordinate2D>. The following symbols should follow suit:

  • -[MGLMapView setVisibleCoordinates:count:edgePadding:animated:]
  • -[MGLMapView setVisibleCoordinates:count:edgePadding:direction:duration:animationTimingFunction:completionHandler:]
  • -[MGLMultiPoint replaceCoordinatesInRange:withCoordinates:]
  • -[MGLMultiPoint appendCoordinates:count:]
  • +[MGLPointCollection pointCollectionWithCoordinates:count:]
  • +[MGLPolygon polygonWithCoordinates:count:]
  • +[MGLPolygon polygonWithCoordinates:count:interiorPolygons:]
  • +[MGLPolyline polylineWithCoordinates:count:]

Application code in Swift will be able to pass in a reference to a let instead of a var, but existing code will compile without errors. For application code in Objective-C, there should be no difference due to this change. So I don’t think it would be considered backwards incompatible.

/cc @boundsj @danpat

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling labels Nov 29, 2016
@1ec5 1ec5 added this to the ios-v3.4.0 milestone Nov 29, 2016
@1ec5 1ec5 self-assigned this Nov 29, 2016
1ec5 added a commit that referenced this issue Nov 29, 2016
@1ec5 1ec5 added annotations Annotations on iOS and macOS or markers on Android MapKit parity For feature parity with MapKit on iOS or macOS and removed runtime styling labels Nov 29, 2016
@1ec5 1ec5 closed this as completed in 4096544 Dec 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
annotations Annotations on iOS and macOS or markers on Android iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS MapKit parity For feature parity with MapKit on iOS or macOS
Projects
None yet
Development

No branches or pull requests

1 participant