Skip to content

Commit 2bfacd9

Browse files
committed
Merge branch 'release/4.0.2'
2 parents 7d5d221 + 9550ad1 commit 2bfacd9

File tree

6 files changed

+19
-9
lines changed

6 files changed

+19
-9
lines changed

Configs/SwiftLocation.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
18+
<string>4.0.2</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ You can also observe for changes in authorization status by subscribing auth cha
130130

131131
```swift
132132
let observerID = LocationManager.shared.onAuthorizationChange.add { newState in
133-
print("Authorization status changed to \(newStatus)")
133+
print("Authorization status changed to \(newState)")
134134
}
135135
```
136136

@@ -425,4 +425,4 @@ LocationManager.shared.autocomplete(partialMatch: .partialSearch("Piazza della R
425425
SwiftLocation is currently owned and maintained by Daniele Margutti.
426426
It's licensed under MIT License.
427427

428-
<div>Icons made by <a href="https://www.flaticon.com/<?=_('authors').'/'?>eucalyp" title="Eucalyp">Eucalyp</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>
428+
<div>Icons made by <a href="https://www.flaticon.com/<?=_('authors').'/'?>eucalyp" title="Eucalyp">Eucalyp</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a></div>

Sources/Locating/LocationRequest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class LocationRequest: ServiceRequest, Hashable {
2929
didSet {
3030
// Also set the callback to receive timeout event; it will remove the request.
3131
timeoutManager?.callback = { interval in
32-
self.stop(reason: .timeout(interval), remove: true)
32+
self.stop(reason: .requiredLocationNotFound(timeout: interval, last: self.lastAbsoluteLocation), remove: true)
3333
}
3434
}
3535
}
@@ -142,7 +142,7 @@ public class LocationRequest: ServiceRequest, Hashable {
142142

143143
// MARK: - Internal Methods -
144144

145-
/// Stop a request with passed error reason and optionally remvoe it from queue.
145+
/// Stop a request with passed error reason and optionally remove it from queue.
146146
///
147147
/// - Parameters:
148148
/// - reason: reason of failure.

Sources/LocationManager+Support.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,23 @@ internal let CLLocationAccuracyAccuracyAny: CLLocationAccuracy = 6000 // 6km or
1515

1616
public extension LocationManager {
1717

18+
/// Errors of the location manager.
19+
///
20+
/// - cancelled: operation was cancelled by the user.
21+
/// - timeout: timeout reached.
22+
/// - invalidAuthStatus: invalid authorization status.
23+
/// - generic: generic error.
24+
/// - noData: no data received from service.
25+
/// - missingAPIKey: missing required api key for service.
26+
/// - requiredLocationNotFound: required accurated location were not found, last found reported.
1827
enum ErrorReason: Error {
1928
case cancelled
2029
case timeout(TimeInterval)
2130
case invalidAuthStatus(CLAuthorizationStatus)
2231
case generic(String)
2332
case noData(URL?)
2433
case missingAPIKey
34+
case requiredLocationNotFound(timeout: TimeInterval, last: CLLocation?)
2535
}
2636

2737
enum State: CustomStringConvertible {

Sources/LocationManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,10 @@ public class LocationManager: NSObject {
566566
}
567567
}
568568

569-
/// Complete all requests in list and remove them.
569+
/// Complete all requests in list and remove them. Optionally you can also pass a reason.
570570
///
571-
/// - Parameter error: error used to complete each request.
572-
private func completeAllLocationRequest(error: ErrorReason) {
571+
/// - Parameter error: error used to complete each request. By default is `.cancelled`.
572+
public func completeAllLocationRequest(error: ErrorReason = .cancelled) {
573573
queueLocationRequests.forEach {
574574
$0.stop(reason: error, remove: true)
575575
updateLocationManagerSettings($0)

SwiftLocation.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "SwiftLocation"
3-
s.version = "4.0.1"
3+
s.version = "4.0.2"
44
s.summary = "Easy and Efficient Location Tracking for iOS"
55
s.description = <<-DESC
66
Efficient location tracking for iOS with support for oneshot/continuous/background tracking, reverse geocoding, autocomplete and more!

0 commit comments

Comments
 (0)