diff --git a/MapboxCoreNavigationTests/DistanceFormatterTests.swift b/MapboxCoreNavigationTests/DistanceFormatterTests.swift index 462d6d03..2663ccad 100644 --- a/MapboxCoreNavigationTests/DistanceFormatterTests.swift +++ b/MapboxCoreNavigationTests/DistanceFormatterTests.swift @@ -30,14 +30,14 @@ class DistanceFormatterTests: XCTestCase { } var effectiveQuantityRange = NSRange(location: NSNotFound, length: 0) - let quantityAttrs = checkedAttributedString.attributes(at: checkedQuantityRange.lowerBound.encodedOffset, effectiveRange: &effectiveQuantityRange) + let quantityAttrs = checkedAttributedString.attributes(at: checkedQuantityRange.lowerBound.utf16Offset(in: checkedAttributedString.string), effectiveRange: &effectiveQuantityRange) XCTAssertEqual(quantityAttrs[NSAttributedString.Key.quantity] as? NSNumber, distance as NSNumber, "'\(quantity)' should have quantity \(distance)") XCTAssertEqual(effectiveQuantityRange.length, quantity.count) - guard checkedQuantityRange.upperBound.encodedOffset < checkedAttributedString.length else { + guard checkedQuantityRange.upperBound.utf16Offset(in: checkedAttributedString.string) < checkedAttributedString.length else { return } - let unitAttrs = checkedAttributedString.attributes(at: checkedQuantityRange.upperBound.encodedOffset, effectiveRange: nil) + let unitAttrs = checkedAttributedString.attributes(at: checkedQuantityRange.upperBound.utf16Offset(in: checkedAttributedString.string), effectiveRange: nil) XCTAssertNil(unitAttrs[NSAttributedString.Key.quantity], "Unit should not be emphasized like a quantity") } diff --git a/MapboxNavigation/NavigationMapView.swift b/MapboxNavigation/NavigationMapView.swift index 62fd2f63..43c395b0 100644 --- a/MapboxNavigation/NavigationMapView.swift +++ b/MapboxNavigation/NavigationMapView.swift @@ -361,7 +361,7 @@ open class NavigationMapView: MLNMapView, UIGestureRecognizerDelegate { } } - // MARK: - Gesture Recognizers + // MARK: - Gesture Recognizers /** Fired when NavigationMapView detects a tap not handled elsewhere by other gesture recognizers.