Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor WMFLocationManager to Swift #3

Open
wants to merge 19 commits into
base: develop
from
Open
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

Remove unused property `significantLocationUpdatesOnly`

This property was never set.
  • Loading branch information
jantimar authored and VojtaStavik committed Feb 28, 2020
commit b23e92378eae8d0559d31648b312d858a80c59e1
@@ -14,8 +14,6 @@

@interface WMFLocationManager () <CLLocationManagerDelegate>

@property (nonatomic, assign, readwrite) BOOL significantLocationUpdatesOnly;

@property (nonatomic, strong, readwrite) CLLocationManager *locationManager;
@property (nonatomic, strong, nullable) id orientationNotificationToken;

@@ -119,13 +117,8 @@ - (BOOL)requestAuthorizationIfNeeded {
CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
if (status == kCLAuthorizationStatusNotDetermined) {
NSParameterAssert([CLLocationManager locationServicesEnabled]);
if (self.significantLocationUpdatesOnly) {
DDLogInfo(@"%@ is requesting authorization to access location always.", self);
[self.locationManager requestAlwaysAuthorization];
} else {
DDLogInfo(@"%@ is requesting authorization to access location when in use.", self);
[self.locationManager requestWhenInUseAuthorization];
}
DDLogInfo(@"%@ is requesting authorization to access location when in use.", self);
[self.locationManager requestWhenInUseAuthorization];
return YES;
}
DDLogVerbose(@"%@ is skipping authorization request because status is %d.", self, status);
@@ -166,11 +159,7 @@ - (void)stopMonitoringLocation {
#pragma mark - Location Updates

- (void)startLocationUpdates {
if (self.significantLocationUpdatesOnly) {
[self.locationManager startMonitoringSignificantLocationChanges];
} else {
[self.locationManager startUpdatingLocation];
}
[self.locationManager startUpdatingLocation];
}

- (void)startHeadingUpdates {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.