Fixed iOS 7 test breakage and crash from #1382
These APIs were introduced in iOS 8+, hence the `-respondsToSelector:` check. But I saw that, thinking it was just redundant, and removed it in #1382, leading to a crash on launch on iOS 7.
This commit is contained in:
@@ -49,11 +49,17 @@
|
||||
}
|
||||
|
||||
- (void)startMonitoringVisits {
|
||||
[self.locationManager startMonitoringVisits];
|
||||
// -[CLLocationManager startMonitoringVisits] is only available in iOS 8+.
|
||||
if ([self.locationManager respondsToSelector:@selector(startMonitoringVisits)]) {
|
||||
[self.locationManager startMonitoringVisits];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)stopMonitoringVisits {
|
||||
[self.locationManager stopMonitoringVisits];
|
||||
// -[CLLocationManager stopMonitoringVisits] is only available in iOS 8+.
|
||||
if ([self.locationManager respondsToSelector:@selector(stopMonitoringVisits)]) {
|
||||
[self.locationManager stopMonitoringVisits];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark CLLocationManagerDelegate
|
||||
|
||||
Reference in New Issue
Block a user