Skip to content

Instantly share code, notes, and snippets.

@mattyoho
Forked from mattetti/user_location.rb
Created January 10, 2010 04:20
Show Gist options
  • Save mattyoho/273330 to your computer and use it in GitHub Desktop.
Save mattyoho/273330 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