Skip to content

Instantly share code, notes, and snippets.

@gmertk
Created May 26, 2015 21:48
Show Gist options
  • Save gmertk/4d51bcf79f226419dc8c to your computer and use it in GitHub Desktop.
Save gmertk/4d51bcf79f226419dc8c to your computer and use it in GitHub Desktop.
Move ranging into didDetermineSate
func locationManager(manager: CLLocationManager!, didDetermineState state: CLRegionState, forRegion region: CLRegion!) {
if let region = region as? CLBeaconRegion {
switch state {
case .Inside:
manager.startRangingBeaconsInRegion(region)
case .Outside:
manager.stopRangingBeaconsInRegion(region)
case .Unknown:
break
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment