Skip to content

Commit

Permalink
vk-NAVIOS-374-attribute-options: member naming improved; CHANGELOG up…
Browse files Browse the repository at this point in the history
…dated;
  • Loading branch information
Udumft committed Oct 10, 2022
1 parent 335d3d2 commit 8a54bd9
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 97 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
### Other Changes

* Added the `Waypoint.layer` property, which can ensure that the route begins on the correct road if it is above or below another road. ([#745](https://github.com/mapbox/mapbox-directions-swift/pull/745))
* Expanded `AttributeOptions` to allow user options with custom values. See `CustomValueOptionSet` for reference. ([#748](https://github.com/mapbox/mapbox-directions-swift/pull/748))
* Expanded `AttributeOptions` to allow user options with custom values. See `AttributeOptions.customOptionsByRawValue` for reference. ([#748](https://github.com/mapbox/mapbox-directions-swift/pull/748))
* Fixed incorrect shape indicies in `RouteLeg.incidents` after route refresh. ([#752](https://github.com/mapbox/mapbox-directions-swift/pull/752))

## 2.7.0
Expand Down
10 changes: 2 additions & 8 deletions Sources/MapboxDirections/AttributeOptions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@ import Foundation
public struct AttributeOptions: CustomValueOptionSet, CustomStringConvertible {
public var rawValue: Int

/**
Provides a text value description for user-provided options.
`AttributeOptions` will recognize a custom option if it's unique `rawValue` flag is set and `customOptions` contains a description for that flag.
Use the `update(customOption:)` method to append a custom option.
*/
public var customOptions: [Int: String] = [:]
public var customOptionsByRawValue: [Int: String] = [:]

public init(rawValue: Int) {
self.rawValue = rawValue
Expand Down Expand Up @@ -118,7 +112,7 @@ public struct AttributeOptions: CustomValueOptionSet, CustomStringConvertible {
if contains(.numericCongestionLevel) {
descriptions.append("congestion_numeric")
}
for (key, value) in customOptions {
for (key, value) in customOptionsByRawValue {
if rawValue & key != 0 {
descriptions.append(value)
}
Expand Down
Loading

0 comments on commit 8a54bd9

Please sign in to comment.