Skip to content

Instantly share code, notes, and snippets.

@heypiotr
Created May 24, 2017 03:15
Show Gist options
  • Select an option

  • Save heypiotr/0f32098f76120414f4853f6857dad4c6 to your computer and use it in GitHub Desktop.

Select an option

Save heypiotr/0f32098f76120414f4853f6857dad4c6 to your computer and use it in GitHub Desktop.
let fetchLocation = EILRequestFetchLocation(locationIdentifier: "my-room")
fetchLocation.sendRequestWithCompletion { (location, error) in
guard let location = location else { return }
self.locationManager.startPositionUpdates(for: location)
}
// ...
func indoorLocationManager(manager: EILIndoorLocationManager,
didUpdatePosition position: EILOrientedPoint,
withAccuracy positionAccuracy: EILPositionAccuracy,
inLocation location: EILLocation) {
let roomCenter = EILPoint(x: 0, y: 0)
if position.distanceToPoint(roomCenter) < 5 {
print("Hello, physical world!")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment