Skip to content

Instantly share code, notes, and snippets.

@citizen428
Forked from mattetti/user_location.rb
Created January 1, 2010 16:55
Show Gist options
  • Save citizen428/267159 to your computer and use it in GitHub Desktop.
Save citizen428/267159 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