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

[ios, macos] Use swift_name for MGLMultiPoint and subclasses #6727

Merged
merged 1 commit into from
Oct 18, 2016

Conversation

boundsj
Copy link
Contributor

@boundsj boundsj commented Oct 18, 2016

In #6524 we added a class factory method to MGLMultiPoint. Since MGLMultiPoint is a superclass of MGLPolyline and MGLPolygon, when modern Swift 3 translation rules are applied, the result is ambiguous class factory method names for MultiPoint -> PolyLine and Polygon.

This change decorates the class factory methods with NS_SWIFT_NAME({shape_name}(coordinates:count:)) so that, at the call site in a modern Swift app, we can write:

MGLPolyline.polyline(coordinates: &coordinates, count: UInt(coordinates.count))

cc @friedbunny @1ec5

Decorate the class factory methods so that when they are translated to
swift the method to create an MGLMultiPoint is not ambiguous with the
methods to create MGLPolygon and MGLPolyline.
@boundsj boundsj added iOS Mapbox Maps SDK for iOS beta blocker Blocks the next beta release labels Oct 18, 2016
@boundsj boundsj added this to the ios-v3.4.0 milestone Oct 18, 2016
@boundsj boundsj self-assigned this Oct 18, 2016
@mention-bot
Copy link

@boundsj, thanks for your PR! By analyzing the history of the files in this pull request, we identified @incanus and @1ec5 to be potential reviewers.

Copy link
Contributor

@1ec5 1ec5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more reason to fix #5201

@1ec5
Copy link
Contributor

1ec5 commented Oct 18, 2016

We discovered that this change would break some existing Swift applications. So we’re going to fix #5201 for the v3.4.0 release, eliminating the need for the +multiPointWithCoordinates:count: method that caused this ambiguity in the first place.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
beta blocker Blocks the next beta release iOS Mapbox Maps SDK for iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants