Checking for iOS Location Services

后端 未结 4 2053
别那么骄傲
别那么骄傲 2020-12-23 10:28

I have a view with a map and a button (like the Maps app once) that allows the user to center and zoom his current location on the map. If I can not use the locationServices

4条回答
  •  醉酒成梦
    2020-12-23 11:23

    - (BOOL) enableLocationServices
    {
    
        if ([CLLocationManager locationServicesEnabled])
        {
            self.locationManager.distanceFilter = 10;
            self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
            [self.locationManager startUpdatingLocation];
            [self.mapview setUserTrackingMode:MKUserTrackingModeFollow animated:YES];
            return YES;
        }
        else
        {
            return NO;
        }
    }
    

提交回复
热议问题