-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add conversions between enumerations and associated values #159
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel really comfortable with the GeometryConvertible and GeoJSONObjectConvertible portions of this PR. It's less obvious whether the JSONValueConvertible portions are what we want. If there's a way to defer those parts, I think it'd be worth taking the extra time.
16fa18c
to
53910de
Compare
I split out the |
Added protocol-based initializers to
Geometry
andGeoJSONObject
that accept each case’s associated value as an initializer argument. This makes the enumerations more consistent with theJSONValue
andFeatureIdentifier
enumerations and simplifies some common workflows.JSONValue and FeatureIdentifier now conform to the
Hashable
protocol. These types are likely to be used as dictionary keys or set members, and it’s pretty easy to make them hashable.Fixes #158.
/cc @mapbox/navigation-ios @mapbox/maps-ios