Skip to content

Instantly share code, notes, and snippets.

@mikedamage
Forked from mattetti/user_location.rb
Created January 9, 2010 21:18
Show Gist options
  • Save mikedamage/273106 to your computer and use it in GitHub Desktop.
Save mikedamage/273106 to your computer and use it in GitHub Desktop.
MacRuby CoreLocation
# 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