Skip to content

Commit 2783581

Browse files
authored
Merge pull request #66 from what3words/staging
Staging
2 parents 9e59ceb + f118189 commit 2783581

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Sources/W3WSwiftComponentsOcr/Ocr/W3WOcrNative.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public class W3WOcrNative: W3WOcrProtocol {
7474

7575
#if canImport(w3w)
7676
public init(sdk: What3Words) {
77-
configure(w3w: sdk)
77+
if let w3w = sdk as? W3WProtocolV4 {
78+
configure(w3w: w3w)
79+
}
7880
}
7981
#endif // w3w
8082

@@ -262,7 +264,7 @@ public class W3WOcrNative: W3WOcrProtocol {
262264

263265
var distance: Double?
264266
if let focusCoords = focus {
265-
distance = sdk.distance(from: focusCoords, to: square.coordinates)
267+
distance = (sdk as? W3WProtocolV4)?.distance(from: focusCoords, to: square.coordinates)
266268
}
267269

268270
let ocrSuggestion = W3WOcrSuggestion(words: square.words,

0 commit comments

Comments
 (0)