Skip to content
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

Changing MBVisualInstructionComponentType.image -> .icon #275

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
## master

* Removed `MBAttributeOpenStreetMapNodeIdentifier, as it is no longer being tracked by the API. This is a breaking change.
* changed `MBVisualInstructionComponentType.image` to `MBVisualInstructionComponentType.icon`, as the API has changed to reflect the possibility of a "Generic Route Shield" icon component being passed back from the service.
8 changes: 4 additions & 4 deletions MapboxDirections/MBVisualInstructionType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public enum VisualInstructionComponentType: Int, CustomStringConvertible {
case text

/**
Component contains an image that should be rendered.
Component either contains an image that should be rendered, or text that should be rendered as a generic icon.
*/
case image
case icon
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m not sure this change is strictly necessary. “Image” and “icon” are roughly synonymous in this context. We went with image for consistency with the VisualInstructionComponent.imageURL property, which is still present regardless of the API change.


/**
The compoment contains the localized word for "exit".
Expand All @@ -41,7 +41,7 @@ public enum VisualInstructionComponentType: Int, CustomStringConvertible {
case "delimiter":
type = .delimiter
case "icon":
type = .image
type = .icon
case "text":
type = .text
case "exit":
Expand All @@ -58,7 +58,7 @@ public enum VisualInstructionComponentType: Int, CustomStringConvertible {
switch self {
case .delimiter:
return "delimiter"
case .image:
case .icon:
return "icon"
case .text:
return "text"
Expand Down