Skip to content

Commit 8734463

Browse files
committed
Clean code
1 parent 1aca0d9 commit 8734463

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

arcgis_map_sdk_ios/ios/arcgis_map_sdk_ios/Sources/arcgis_map_sdk_ios/ManualLocationDataSource.swift

+7-8
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,19 @@ import ArcGIS
1010

1111
final class CustomLocationProvider: LocationProvider {
1212
private var locationContinuation: AsyncThrowingStream<Location, Error>.Continuation?
13+
private var headingContinuation: AsyncThrowingStream<Double, Error>.Continuation?
14+
1315

1416
// Exposed stream
1517
var locations: AsyncThrowingStream<Location, Error> {
1618
AsyncThrowingStream { continuation in
1719
self.locationContinuation = continuation
1820
}
1921
}
20-
22+
2123
var headings: AsyncThrowingStream<Double, Error> {
2224
AsyncThrowingStream { continuation in
23-
Task {
24-
while !Task.isCancelled {
25-
continuation.yield(.random(in: 0...360))
26-
await Task.yield()
27-
}
28-
continuation.finish()
29-
}
25+
self.headingContinuation = continuation
3026
}
3127
}
3228

@@ -41,6 +37,9 @@ final class CustomLocationProvider: LocationProvider {
4137
isLastKnown: false
4238
)
4339
locationContinuation?.yield(loc)
40+
if let heading = position.heading {
41+
headingContinuation?.yield(heading)
42+
}
4443
}
4544
}
4645

arcgis_map_sdk_ios/ios/arcgis_map_sdk_ios/Sources/arcgis_map_sdk_ios/Models/AnimationOptions.swift

-16
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,3 @@ struct AnimationOptions: Codable {
1313
var animationCurve: String
1414
}
1515

16-
extension AnimationOptions {
17-
// func arcgisAnimationCurve() -> AGSAnimationCurve {
18-
// switch animationCurve {
19-
// case "linear":
20-
// return .linear
21-
// case "easeIn":
22-
// return .easeInCirc
23-
// case "easeOut":
24-
// return .easeOutCirc
25-
// case "easeInOut":
26-
// return .easeInOutCirc
27-
// default:
28-
// return .linear
29-
// }
30-
// }
31-
}

0 commit comments

Comments
 (0)