title: Ranging Beacons in iOS 10
body: <p>In my app, I use Beacon Region Monitoring in CoreLocation.
  The app sets 2 proximityUUID as region (they have different id),
  and start ranging like following.</p>
  
  <pre><code>#pragma mark - CLLocationManagerDelegate
  
  (void)locationManager:(CLLocationManager *)manager
  didEnterRegion:(CLRegion *)region {
       [self.locationManager requestStateForRegion:(CLBeaconRegion *)region];
  }
  
  - (void)locationManager:(CLLocationManager *)manager 
  didExitRegion:(CLRegion *)region {
       [self.locationManager stopRangingBeaconsInRegion:(CLBeaconRegion *)region]; 
  }
  
  - (void)locationManager:(CLLocationManager *)manager
  didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region{ 
      for(CLBeacon* b in beacons){
           //output only previous beacon if it's before regionout to previous region
           NSLog(@"%@",b);
      }
  }
  
  - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {
       //error
  }
  
  - (void)locationManager:(CLLocationManager *)manager didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region{ 
     if(state == CLRegionStateInside){
          if ([region isMemberOfClass:[CLBeaconRegion class]] &amp;&amp; [CLLocationManager isRangingAvailable]){
              [self.locationManager startRangingBeaconsInRegion:(CLBeaconRegion *)region];
          }
    }
  }
  </code></pre>
  
  <p>It works in iOS 8 and iOS 9, but it does not work in iOS 10.</p>
  
  <p>[in iOS 8/iOS 9]</p>
  
  <pre><code>1.broadcast beacon1
  
  2.[app]didRangeBeacons (beacon1)
  
  3.stop beacon1 and broadcast beacon2
  
  4.[app]didRangeBeacons (beacon2)
  </code></pre>
  
  <p>[iOS 10]</p>
  
  <pre><code>1.broadcast beacon1
  
  2.[app]didRangeBeacons (beacon1)
  
  3.stop beacon1 and broadcast beacon2
  
  4.[app]didRangeBeacons (**beacon1**)
  </code></pre>
  
  <p>Is it a bug of iOS 10?</p>