diff --git a/platform/darwin/http_request_nsurl.mm b/platform/darwin/http_request_nsurl.mm index 509e158af..0006dbef8 100644 --- a/platform/darwin/http_request_nsurl.mm +++ b/platform/darwin/http_request_nsurl.mm @@ -153,7 +153,7 @@ void HTTPRequest::start() { @autoreleasepool { - NSMutableString *url = [[NSMutableString alloc] initWithString:@(resource.url.c_str())]; + NSMutableString *url = [NSMutableString stringWithString:@(resource.url.c_str())]; if ([[NSUserDefaults standardUserDefaults] objectForKey:@"mapbox_metrics_disabled"] == nil) { if ([url rangeOfString:@"?"].location == NSNotFound) { [url appendString:@"?"]; @@ -163,8 +163,7 @@ void HTTPRequest::start() { [url appendString:@"events=true"]; } - NSMutableURLRequest *req = [[NSMutableURLRequest alloc] - initWithURL:[NSURL URLWithString:url]]; + NSMutableURLRequest *req = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]]; if (existingResponse) { if (!existingResponse->etag.empty()) { [req addValue:@(existingResponse->etag.c_str()) forHTTPHeaderField:@"If-None-Match"]; @@ -179,7 +178,6 @@ void HTTPRequest::start() { task = [context->session dataTaskWithRequest:req completionHandler:^(NSData *data, NSURLResponse *res, NSError *error) { handleResult(data, res, error); }]; - [req release]; [task retain]; [task resume]; } diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 53c752660..9fd94fc7b 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -1079,22 +1079,19 @@ std::chrono::steady_clock::duration secondsAsDuration(float duration) { CGPoint doubleTapPoint = [doubleTap locationInView:doubleTap.view]; - CGPoint zoomInPoint; - + CGPoint zoomInPoint = doubleTapPoint; + CGPoint userPoint = [self convertCoordinate:self.userLocation.coordinate toPointToView:self]; if (self.userTrackingMode != MGLUserTrackingModeNone) { - CGPoint userPoint = [self convertCoordinate:self.userLocation.coordinate toPointToView:self]; CGRect userLocationRect = CGRectMake(userPoint.x - 40, userPoint.y - 40, 80, 80); if (CGRectContainsPoint(userLocationRect, doubleTapPoint)) { zoomInPoint = userPoint; } } - else + if ( ! CGPointEqualToPoint(zoomInPoint, userPoint)) { self.userTrackingMode = MGLUserTrackingModeNone; - - zoomInPoint = doubleTapPoint; } _mbglMap->scaleBy(2, zoomInPoint.x, zoomInPoint.y, secondsAsDuration(MGLAnimationDuration)); diff --git a/platform/ios/MGLMapboxEvents.m b/platform/ios/MGLMapboxEvents.m index 36ed63d33..4450fa87f 100644 --- a/platform/ios/MGLMapboxEvents.m +++ b/platform/ios/MGLMapboxEvents.m @@ -617,10 +617,11 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; NSString *ssid = nil; CFArrayRef interfaces = CNCopySupportedInterfaces(); if (interfaces) { - NSDictionary *info = (__bridge NSDictionary *)CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(interfaces, 0)); + NSDictionary *info = CFBridgingRelease(CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(interfaces, 0))); if (info) { ssid = info[@"SSID"]; } + CFRelease(interfaces); } return ssid; @@ -699,7 +700,6 @@ NSString *const MGLEventGestureRotateStart = @"Rotation"; if([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { SecTrustRef serverTrust = [[challenge protectionSpace] serverTrust]; - NSString *domain = [[challenge protectionSpace] host]; SecTrustResultType trustResult; // Validate the certificate chain with the device's trust store anyway diff --git a/platform/ios/MGLMetricsLocationManager.m b/platform/ios/MGLMetricsLocationManager.m index 848b4a051..9c186e4bf 100644 --- a/platform/ios/MGLMetricsLocationManager.m +++ b/platform/ios/MGLMetricsLocationManager.m @@ -89,34 +89,17 @@ } - (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { - NSString *newStatus = nil; switch (status) { - case kCLAuthorizationStatusNotDetermined: - newStatus = @"User Hasn't Determined Yet"; - break; - case kCLAuthorizationStatusRestricted: - newStatus = @"Restricted and Can't Be Changed By User"; - break; case kCLAuthorizationStatusDenied: - newStatus = @"User Explcitly Denied"; [self stopUpdatingLocation]; [self stopMonitoringVisits]; break; case kCLAuthorizationStatusAuthorized: - newStatus = @"User Has Authorized / Authorized Always"; - [self startUpdatingLocation]; - [self startMonitoringVisits]; - break; -// case kCLAuthorizationStatusAuthorizedAlways: -// newStatus = @"Not Determined"; -// break; case kCLAuthorizationStatusAuthorizedWhenInUse: - newStatus = @"User Has Authorized When In Use Only"; [self startUpdatingLocation]; [self startMonitoringVisits]; break; default: - newStatus = @"Unknown"; break; } }