Skip to content

Instantly share code, notes, and snippets.

@mattetti
Created December 31, 2009 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save mattetti/266916 to your computer and use it in GitHub Desktop.
Save mattetti/266916 to your computer and use it in GitHub Desktop.
# This is how you can get a user's location using MacRuby and CoreLocation
framework 'CoreLocation'
def locationManager(manager, didUpdateToLocation: new_location, fromLocation: old_location)
puts "location: #{new_location.description}"
exit
end
loc = CLLocationManager.alloc.init
loc.delegate = self
loc.startUpdatingLocation
NSRunLoop.currentRunLoop.runUntilDate(NSDate.distantFuture)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment