File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Sources/d3-async-location/enum Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -28,3 +28,26 @@ public enum AsyncLocationErrors: Error{
28
28
case coreLocationManagerError( CLError )
29
29
30
30
}
31
+
32
+
33
+ @available ( iOS 14 . 0 , watchOS 7 . 0 , * )
34
+ extension AsyncLocationErrors : LocalizedError {
35
+ public var errorDescription : String ? {
36
+ switch self {
37
+ case . accessIsNotAuthorized:
38
+ return NSLocalizedString ( " Access was denied by the user. " , comment: " " )
39
+
40
+ case . streamingProcessHasAlreadyStarted:
41
+ return NSLocalizedString ( " Attempted to start streaming while it's already running. " , comment: " " )
42
+
43
+ case . streamCanceled:
44
+ return NSLocalizedString ( " The stream was cancelled or terminated. " , comment: " " )
45
+
46
+ case . streamUnknownTermination:
47
+ return NSLocalizedString ( " The stream was cancelled or terminated due to an unknown error. " , comment: " " )
48
+
49
+ case . coreLocationManagerError( let error) :
50
+ return error. localizedDescription
51
+ }
52
+ }
53
+ }
You can’t perform that action at this time.
0 commit comments